main.app.cash.backfila.protos.clientservice.RunBatchRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Backfila is a service that manages backfill state, calling into other services to do batched work.
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: app.cash.backfila.protos.clientservice.RunBatchRequest in app/cash/backfila/client_service.proto
package app.cash.backfila.protos.clientservice;
import com.squareup.wire.FieldEncoding;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import com.squareup.wire.ProtoReader;
import com.squareup.wire.ProtoWriter;
import com.squareup.wire.ReverseProtoWriter;
import com.squareup.wire.Syntax;
import com.squareup.wire.WireField;
import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.lang.Boolean;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Map;
import okio.ByteString;
public final class RunBatchRequest extends Message {
public static final ProtoAdapter ADAPTER = new ProtoAdapter_RunBatchRequest();
private static final long serialVersionUID = 0L;
public static final String DEFAULT_BACKFILL_ID = "";
public static final String DEFAULT_BACKFILL_NAME = "";
public static final String DEFAULT_PARTITION_NAME = "";
public static final Boolean DEFAULT_DRY_RUN = false;
public static final Long DEFAULT_BATCH_SIZE = 0L;
/**
* A unique identifier for this backfill run.
* Can be used as a caching key since backfill metadata is immutable after creation.
*/
@WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING"
)
public final String backfill_id;
@WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING"
)
public final String backfill_name;
@WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#STRING"
)
public final String partition_name;
@WireField(
tag = 4,
adapter = "app.cash.backfila.protos.clientservice.KeyRange#ADAPTER"
)
public final KeyRange batch_range;
/**
* User provided parameters at creation.
*/
@WireField(
tag = 5,
keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
adapter = "com.squareup.wire.ProtoAdapter#BYTES"
)
public final Map parameters;
@WireField(
tag = 6,
adapter = "com.squareup.wire.ProtoAdapter#BOOL"
)
public final Boolean dry_run;
/**
* Provided data from the source backfill if this is the target backfill in a pipelined backfill.
*/
@WireField(
tag = 7,
adapter = "app.cash.backfila.protos.clientservice.PipelinedData#ADAPTER"
)
public final PipelinedData pipelined_data;
/**
* Current batch size set for this backfill run. A backfila client may use choose to use this but
* others may run the entire range. Consult your client implementations for exact behaviour.
*/
@WireField(
tag = 8,
adapter = "com.squareup.wire.ProtoAdapter#UINT64"
)
public final Long batch_size;
public RunBatchRequest(String backfill_id, String backfill_name, String partition_name,
KeyRange batch_range, Map parameters, Boolean dry_run,
PipelinedData pipelined_data, Long batch_size) {
this(backfill_id, backfill_name, partition_name, batch_range, parameters, dry_run, pipelined_data, batch_size, ByteString.EMPTY);
}
public RunBatchRequest(String backfill_id, String backfill_name, String partition_name,
KeyRange batch_range, Map parameters, Boolean dry_run,
PipelinedData pipelined_data, Long batch_size, ByteString unknownFields) {
super(ADAPTER, unknownFields);
this.backfill_id = backfill_id;
this.backfill_name = backfill_name;
this.partition_name = partition_name;
this.batch_range = batch_range;
this.parameters = Internal.immutableCopyOf("parameters", parameters);
this.dry_run = dry_run;
this.pipelined_data = pipelined_data;
this.batch_size = batch_size;
}
@Override
public Builder newBuilder() {
Builder builder = new Builder();
builder.backfill_id = backfill_id;
builder.backfill_name = backfill_name;
builder.partition_name = partition_name;
builder.batch_range = batch_range;
builder.parameters = Internal.copyOf(parameters);
builder.dry_run = dry_run;
builder.pipelined_data = pipelined_data;
builder.batch_size = batch_size;
builder.addUnknownFields(unknownFields());
return builder;
}
@Override
public boolean equals(Object other) {
if (other == this) return true;
if (!(other instanceof RunBatchRequest)) return false;
RunBatchRequest o = (RunBatchRequest) other;
return unknownFields().equals(o.unknownFields())
&& Internal.equals(backfill_id, o.backfill_id)
&& Internal.equals(backfill_name, o.backfill_name)
&& Internal.equals(partition_name, o.partition_name)
&& Internal.equals(batch_range, o.batch_range)
&& parameters.equals(o.parameters)
&& Internal.equals(dry_run, o.dry_run)
&& Internal.equals(pipelined_data, o.pipelined_data)
&& Internal.equals(batch_size, o.batch_size);
}
@Override
public int hashCode() {
int result = super.hashCode;
if (result == 0) {
result = unknownFields().hashCode();
result = result * 37 + (backfill_id != null ? backfill_id.hashCode() : 0);
result = result * 37 + (backfill_name != null ? backfill_name.hashCode() : 0);
result = result * 37 + (partition_name != null ? partition_name.hashCode() : 0);
result = result * 37 + (batch_range != null ? batch_range.hashCode() : 0);
result = result * 37 + parameters.hashCode();
result = result * 37 + (dry_run != null ? dry_run.hashCode() : 0);
result = result * 37 + (pipelined_data != null ? pipelined_data.hashCode() : 0);
result = result * 37 + (batch_size != null ? batch_size.hashCode() : 0);
super.hashCode = result;
}
return result;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
if (backfill_id != null) builder.append(", backfill_id=").append(Internal.sanitize(backfill_id));
if (backfill_name != null) builder.append(", backfill_name=").append(Internal.sanitize(backfill_name));
if (partition_name != null) builder.append(", partition_name=").append(Internal.sanitize(partition_name));
if (batch_range != null) builder.append(", batch_range=").append(batch_range);
if (!parameters.isEmpty()) builder.append(", parameters=").append(parameters);
if (dry_run != null) builder.append(", dry_run=").append(dry_run);
if (pipelined_data != null) builder.append(", pipelined_data=").append(pipelined_data);
if (batch_size != null) builder.append(", batch_size=").append(batch_size);
return builder.replace(0, 2, "RunBatchRequest{").append('}').toString();
}
public static final class Builder extends Message.Builder {
public String backfill_id;
public String backfill_name;
public String partition_name;
public KeyRange batch_range;
public Map parameters;
public Boolean dry_run;
public PipelinedData pipelined_data;
public Long batch_size;
public Builder() {
parameters = Internal.newMutableMap();
}
/**
* A unique identifier for this backfill run.
* Can be used as a caching key since backfill metadata is immutable after creation.
*/
public Builder backfill_id(String backfill_id) {
this.backfill_id = backfill_id;
return this;
}
public Builder backfill_name(String backfill_name) {
this.backfill_name = backfill_name;
return this;
}
public Builder partition_name(String partition_name) {
this.partition_name = partition_name;
return this;
}
public Builder batch_range(KeyRange batch_range) {
this.batch_range = batch_range;
return this;
}
/**
* User provided parameters at creation.
*/
public Builder parameters(Map parameters) {
Internal.checkElementsNotNull(parameters);
this.parameters = parameters;
return this;
}
public Builder dry_run(Boolean dry_run) {
this.dry_run = dry_run;
return this;
}
/**
* Provided data from the source backfill if this is the target backfill in a pipelined backfill.
*/
public Builder pipelined_data(PipelinedData pipelined_data) {
this.pipelined_data = pipelined_data;
return this;
}
/**
* Current batch size set for this backfill run. A backfila client may use choose to use this but
* others may run the entire range. Consult your client implementations for exact behaviour.
*/
public Builder batch_size(Long batch_size) {
this.batch_size = batch_size;
return this;
}
@Override
public RunBatchRequest build() {
return new RunBatchRequest(backfill_id, backfill_name, partition_name, batch_range, parameters, dry_run, pipelined_data, batch_size, super.buildUnknownFields());
}
}
private static final class ProtoAdapter_RunBatchRequest extends ProtoAdapter {
private ProtoAdapter