All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.app.cash.backfila.protos.service.CreateBackfillRequest Maven / Gradle / Ivy

Go to download

Backfila is a service that manages backfill state, calling into other services to do batched work.

There is a newer version: 2024.10.28.205607-fab304f
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: app.cash.backfila.protos.service.CreateBackfillRequest in app/cash/backfila/service.proto
package app.cash.backfila.protos.service;

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.Integer;
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 CreateBackfillRequest extends Message {
  public static final ProtoAdapter ADAPTER = new ProtoAdapter_CreateBackfillRequest();

  private static final long serialVersionUID = 0L;

  public static final String DEFAULT_BACKFILL_NAME = "";

  public static final Long DEFAULT_SCAN_SIZE = 0L;

  public static final Long DEFAULT_BATCH_SIZE = 0L;

  public static final Integer DEFAULT_NUM_THREADS = 0;

  public static final ByteString DEFAULT_PKEY_RANGE_START = ByteString.EMPTY;

  public static final ByteString DEFAULT_PKEY_RANGE_END = ByteString.EMPTY;

  public static final Boolean DEFAULT_DRY_RUN = false;

  public static final String DEFAULT_BACKOFF_SCHEDULE = "";

  public static final Long DEFAULT_EXTRA_SLEEP_MS = 0L;

  @WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#STRING"
  )
  public final String backfill_name;

  @WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64"
  )
  public final Long scan_size;

  @WireField(
      tag = 3,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64"
  )
  public final Long batch_size;

  @WireField(
      tag = 4,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32"
  )
  public final Integer num_threads;

  @WireField(
      tag = 5,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES"
  )
  public final ByteString pkey_range_start;

  @WireField(
      tag = 6,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES"
  )
  public final ByteString pkey_range_end;

  /**
   * Parameters that go to the client service.
   */
  @WireField(
      tag = 7,
      keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
      adapter = "com.squareup.wire.ProtoAdapter#BYTES"
  )
  public final Map parameter_map;

  @WireField(
      tag = 8,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL"
  )
  public final Boolean dry_run;

  @WireField(
      tag = 9,
      adapter = "com.squareup.wire.ProtoAdapter#STRING"
  )
  public final String backoff_schedule;

  @WireField(
      tag = 10,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64"
  )
  public final Long extra_sleep_ms;

  public CreateBackfillRequest(String backfill_name, Long scan_size, Long batch_size,
      Integer num_threads, ByteString pkey_range_start, ByteString pkey_range_end,
      Map parameter_map, Boolean dry_run, String backoff_schedule,
      Long extra_sleep_ms) {
    this(backfill_name, scan_size, batch_size, num_threads, pkey_range_start, pkey_range_end, parameter_map, dry_run, backoff_schedule, extra_sleep_ms, ByteString.EMPTY);
  }

  public CreateBackfillRequest(String backfill_name, Long scan_size, Long batch_size,
      Integer num_threads, ByteString pkey_range_start, ByteString pkey_range_end,
      Map parameter_map, Boolean dry_run, String backoff_schedule,
      Long extra_sleep_ms, ByteString unknownFields) {
    super(ADAPTER, unknownFields);
    this.backfill_name = backfill_name;
    this.scan_size = scan_size;
    this.batch_size = batch_size;
    this.num_threads = num_threads;
    this.pkey_range_start = pkey_range_start;
    this.pkey_range_end = pkey_range_end;
    this.parameter_map = Internal.immutableCopyOf("parameter_map", parameter_map);
    this.dry_run = dry_run;
    this.backoff_schedule = backoff_schedule;
    this.extra_sleep_ms = extra_sleep_ms;
  }

  @Override
  public Builder newBuilder() {
    Builder builder = new Builder();
    builder.backfill_name = backfill_name;
    builder.scan_size = scan_size;
    builder.batch_size = batch_size;
    builder.num_threads = num_threads;
    builder.pkey_range_start = pkey_range_start;
    builder.pkey_range_end = pkey_range_end;
    builder.parameter_map = Internal.copyOf(parameter_map);
    builder.dry_run = dry_run;
    builder.backoff_schedule = backoff_schedule;
    builder.extra_sleep_ms = extra_sleep_ms;
    builder.addUnknownFields(unknownFields());
    return builder;
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof CreateBackfillRequest)) return false;
    CreateBackfillRequest o = (CreateBackfillRequest) other;
    return unknownFields().equals(o.unknownFields())
        && Internal.equals(backfill_name, o.backfill_name)
        && Internal.equals(scan_size, o.scan_size)
        && Internal.equals(batch_size, o.batch_size)
        && Internal.equals(num_threads, o.num_threads)
        && Internal.equals(pkey_range_start, o.pkey_range_start)
        && Internal.equals(pkey_range_end, o.pkey_range_end)
        && parameter_map.equals(o.parameter_map)
        && Internal.equals(dry_run, o.dry_run)
        && Internal.equals(backoff_schedule, o.backoff_schedule)
        && Internal.equals(extra_sleep_ms, o.extra_sleep_ms);
  }

  @Override
  public int hashCode() {
    int result = super.hashCode;
    if (result == 0) {
      result = unknownFields().hashCode();
      result = result * 37 + (backfill_name != null ? backfill_name.hashCode() : 0);
      result = result * 37 + (scan_size != null ? scan_size.hashCode() : 0);
      result = result * 37 + (batch_size != null ? batch_size.hashCode() : 0);
      result = result * 37 + (num_threads != null ? num_threads.hashCode() : 0);
      result = result * 37 + (pkey_range_start != null ? pkey_range_start.hashCode() : 0);
      result = result * 37 + (pkey_range_end != null ? pkey_range_end.hashCode() : 0);
      result = result * 37 + parameter_map.hashCode();
      result = result * 37 + (dry_run != null ? dry_run.hashCode() : 0);
      result = result * 37 + (backoff_schedule != null ? backoff_schedule.hashCode() : 0);
      result = result * 37 + (extra_sleep_ms != null ? extra_sleep_ms.hashCode() : 0);
      super.hashCode = result;
    }
    return result;
  }

  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    if (backfill_name != null) builder.append(", backfill_name=").append(Internal.sanitize(backfill_name));
    if (scan_size != null) builder.append(", scan_size=").append(scan_size);
    if (batch_size != null) builder.append(", batch_size=").append(batch_size);
    if (num_threads != null) builder.append(", num_threads=").append(num_threads);
    if (pkey_range_start != null) builder.append(", pkey_range_start=").append(pkey_range_start);
    if (pkey_range_end != null) builder.append(", pkey_range_end=").append(pkey_range_end);
    if (!parameter_map.isEmpty()) builder.append(", parameter_map=").append(parameter_map);
    if (dry_run != null) builder.append(", dry_run=").append(dry_run);
    if (backoff_schedule != null) builder.append(", backoff_schedule=").append(Internal.sanitize(backoff_schedule));
    if (extra_sleep_ms != null) builder.append(", extra_sleep_ms=").append(extra_sleep_ms);
    return builder.replace(0, 2, "CreateBackfillRequest{").append('}').toString();
  }

  public static final class Builder extends Message.Builder {
    public String backfill_name;

    public Long scan_size;

    public Long batch_size;

    public Integer num_threads;

    public ByteString pkey_range_start;

    public ByteString pkey_range_end;

    public Map parameter_map;

    public Boolean dry_run;

    public String backoff_schedule;

    public Long extra_sleep_ms;

    public Builder() {
      parameter_map = Internal.newMutableMap();
    }

    public Builder backfill_name(String backfill_name) {
      this.backfill_name = backfill_name;
      return this;
    }

    public Builder scan_size(Long scan_size) {
      this.scan_size = scan_size;
      return this;
    }

    public Builder batch_size(Long batch_size) {
      this.batch_size = batch_size;
      return this;
    }

    public Builder num_threads(Integer num_threads) {
      this.num_threads = num_threads;
      return this;
    }

    public Builder pkey_range_start(ByteString pkey_range_start) {
      this.pkey_range_start = pkey_range_start;
      return this;
    }

    public Builder pkey_range_end(ByteString pkey_range_end) {
      this.pkey_range_end = pkey_range_end;
      return this;
    }

    /**
     * Parameters that go to the client service.
     */
    public Builder parameter_map(Map parameter_map) {
      Internal.checkElementsNotNull(parameter_map);
      this.parameter_map = parameter_map;
      return this;
    }

    public Builder dry_run(Boolean dry_run) {
      this.dry_run = dry_run;
      return this;
    }

    public Builder backoff_schedule(String backoff_schedule) {
      this.backoff_schedule = backoff_schedule;
      return this;
    }

    public Builder extra_sleep_ms(Long extra_sleep_ms) {
      this.extra_sleep_ms = extra_sleep_ms;
      return this;
    }

    @Override
    public CreateBackfillRequest build() {
      return new CreateBackfillRequest(backfill_name, scan_size, batch_size, num_threads, pkey_range_start, pkey_range_end, parameter_map, dry_run, backoff_schedule, extra_sleep_ms, super.buildUnknownFields());
    }
  }

  private static final class ProtoAdapter_CreateBackfillRequest extends ProtoAdapter {
    private ProtoAdapter> parameter_map;

    public ProtoAdapter_CreateBackfillRequest() {
      super(FieldEncoding.LENGTH_DELIMITED, CreateBackfillRequest.class, "type.googleapis.com/app.cash.backfila.protos.service.CreateBackfillRequest", Syntax.PROTO_2, null, "app/cash/backfila/service.proto");
    }

    @Override
    public int encodedSize(CreateBackfillRequest value) {
      int result = 0;
      result += ProtoAdapter.STRING.encodedSizeWithTag(1, value.backfill_name);
      result += ProtoAdapter.UINT64.encodedSizeWithTag(2, value.scan_size);
      result += ProtoAdapter.UINT64.encodedSizeWithTag(3, value.batch_size);
      result += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.num_threads);
      result += ProtoAdapter.BYTES.encodedSizeWithTag(5, value.pkey_range_start);
      result += ProtoAdapter.BYTES.encodedSizeWithTag(6, value.pkey_range_end);
      result += parameter_mapAdapter().encodedSizeWithTag(7, value.parameter_map);
      result += ProtoAdapter.BOOL.encodedSizeWithTag(8, value.dry_run);
      result += ProtoAdapter.STRING.encodedSizeWithTag(9, value.backoff_schedule);
      result += ProtoAdapter.UINT64.encodedSizeWithTag(10, value.extra_sleep_ms);
      result += value.unknownFields().size();
      return result;
    }

    @Override
    public void encode(ProtoWriter writer, CreateBackfillRequest value) throws IOException {
      ProtoAdapter.STRING.encodeWithTag(writer, 1, value.backfill_name);
      ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.scan_size);
      ProtoAdapter.UINT64.encodeWithTag(writer, 3, value.batch_size);
      ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.num_threads);
      ProtoAdapter.BYTES.encodeWithTag(writer, 5, value.pkey_range_start);
      ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.pkey_range_end);
      parameter_mapAdapter().encodeWithTag(writer, 7, value.parameter_map);
      ProtoAdapter.BOOL.encodeWithTag(writer, 8, value.dry_run);
      ProtoAdapter.STRING.encodeWithTag(writer, 9, value.backoff_schedule);
      ProtoAdapter.UINT64.encodeWithTag(writer, 10, value.extra_sleep_ms);
      writer.writeBytes(value.unknownFields());
    }

    @Override
    public void encode(ReverseProtoWriter writer, CreateBackfillRequest value) throws IOException {
      writer.writeBytes(value.unknownFields());
      ProtoAdapter.UINT64.encodeWithTag(writer, 10, value.extra_sleep_ms);
      ProtoAdapter.STRING.encodeWithTag(writer, 9, value.backoff_schedule);
      ProtoAdapter.BOOL.encodeWithTag(writer, 8, value.dry_run);
      parameter_mapAdapter().encodeWithTag(writer, 7, value.parameter_map);
      ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.pkey_range_end);
      ProtoAdapter.BYTES.encodeWithTag(writer, 5, value.pkey_range_start);
      ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.num_threads);
      ProtoAdapter.UINT64.encodeWithTag(writer, 3, value.batch_size);
      ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.scan_size);
      ProtoAdapter.STRING.encodeWithTag(writer, 1, value.backfill_name);
    }

    @Override
    public CreateBackfillRequest decode(ProtoReader reader) throws IOException {
      Builder builder = new Builder();
      long token = reader.beginMessage();
      for (int tag; (tag = reader.nextTag()) != -1;) {
        switch (tag) {
          case 1: builder.backfill_name(ProtoAdapter.STRING.decode(reader)); break;
          case 2: builder.scan_size(ProtoAdapter.UINT64.decode(reader)); break;
          case 3: builder.batch_size(ProtoAdapter.UINT64.decode(reader)); break;
          case 4: builder.num_threads(ProtoAdapter.UINT32.decode(reader)); break;
          case 5: builder.pkey_range_start(ProtoAdapter.BYTES.decode(reader)); break;
          case 6: builder.pkey_range_end(ProtoAdapter.BYTES.decode(reader)); break;
          case 7: builder.parameter_map.putAll(parameter_mapAdapter().decode(reader)); break;
          case 8: builder.dry_run(ProtoAdapter.BOOL.decode(reader)); break;
          case 9: builder.backoff_schedule(ProtoAdapter.STRING.decode(reader)); break;
          case 10: builder.extra_sleep_ms(ProtoAdapter.UINT64.decode(reader)); break;
          default: {
            reader.readUnknownField(tag);
          }
        }
      }
      builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
      return builder.build();
    }

    @Override
    public CreateBackfillRequest redact(CreateBackfillRequest value) {
      Builder builder = value.newBuilder();
      builder.clearUnknownFields();
      return builder.build();
    }

    private ProtoAdapter> parameter_mapAdapter() {
      ProtoAdapter> result = parameter_map;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.BYTES);
        parameter_map = result;
      }
      return result;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy