// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/protobuf/service_config.proto

package org.tensorflow.proto.data.experimental;

public final class ServiceConfig {
  private ServiceConfig() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface DispatcherConfigOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.DispatcherConfig)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The port for the dispatcher to bind to. A value of 0 indicates that the
     * dispatcher may bind to any available port.
     * </pre>
     *
     * <code>int64 port = 1;</code>
     */
    long getPort();

    /**
     * <pre>
     * The protocol for the dispatcher to use when connecting to workers.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    java.lang.String getProtocol();
    /**
     * <pre>
     * The protocol for the dispatcher to use when connecting to workers.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    com.google.protobuf.ByteString
        getProtocolBytes();

    /**
     * <pre>
     * A work directory to use for storing dispatcher state, and for recovering
     * during restarts. The empty string indicates not to use any work directory.
     * </pre>
     *
     * <code>string work_dir = 3;</code>
     */
    java.lang.String getWorkDir();
    /**
     * <pre>
     * A work directory to use for storing dispatcher state, and for recovering
     * during restarts. The empty string indicates not to use any work directory.
     * </pre>
     *
     * <code>string work_dir = 3;</code>
     */
    com.google.protobuf.ByteString
        getWorkDirBytes();

    /**
     * <pre>
     * Whether to run in fault tolerant mode, where dispatcher state is saved
     * across restarts. Requires that `work_dir` is nonempty.
     * </pre>
     *
     * <code>bool fault_tolerant_mode = 4;</code>
     */
    boolean getFaultTolerantMode();

    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    java.util.List<java.lang.String>
        getWorkerAddressesList();
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    int getWorkerAddressesCount();
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    java.lang.String getWorkerAddresses(int index);
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    com.google.protobuf.ByteString
        getWorkerAddressesBytes(int index);

    /**
     * <pre>
     * How often the dispatcher should scan through to delete old and unused
     * jobs. A value of 0 indicates that the decision should be left up to the
     * runtime.
     * </pre>
     *
     * <code>int64 job_gc_check_interval_ms = 5;</code>
     */
    long getJobGcCheckIntervalMs();

    /**
     * <pre>
     * How long a job needs to be unused before it becomes a candidate for garbage
     * collection. A value of -1 indicates that jobs should never be garbage
     * collected. A value of 0 indicates that the decision should be left up to
     * the runtime.
     * </pre>
     *
     * <code>int64 job_gc_timeout_ms = 6;</code>
     */
    long getJobGcTimeoutMs();

    /**
     * <pre>
     * How long to wait before garbage-collecting a client that hasn't
     * heartbeated to the dispatcher. A value of 0 indicates that the timeout
     * should be left to the runtime.
     * </pre>
     *
     * <code>int64 client_timeout_ms = 8;</code>
     */
    long getClientTimeoutMs();
  }
  /**
   * <pre>
   * Configuration for a tf.data service DispatchServer.
   * Next id: 9
   * </pre>
   *
   * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig}
   */
  public  static final class DispatcherConfig extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.DispatcherConfig)
      DispatcherConfigOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use DispatcherConfig.newBuilder() to construct.
    private DispatcherConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private DispatcherConfig() {
      protocol_ = "";
      workDir_ = "";
      workerAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(
        UnusedPrivateParameter unused) {
      return new DispatcherConfig();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private DispatcherConfig(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 8: {

              port_ = input.readInt64();
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();

              protocol_ = s;
              break;
            }
            case 26: {
              java.lang.String s = input.readStringRequireUtf8();

              workDir_ = s;
              break;
            }
            case 32: {

              faultTolerantMode_ = input.readBool();
              break;
            }
            case 40: {

              jobGcCheckIntervalMs_ = input.readInt64();
              break;
            }
            case 48: {

              jobGcTimeoutMs_ = input.readInt64();
              break;
            }
            case 58: {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                workerAddresses_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000001;
              }
              workerAddresses_.add(s);
              break;
            }
            case 64: {

              clientTimeoutMs_ = input.readInt64();
              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          workerAddresses_ = workerAddresses_.getUnmodifiableView();
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class);
    }

    public static final int PORT_FIELD_NUMBER = 1;
    private long port_;
    /**
     * <pre>
     * The port for the dispatcher to bind to. A value of 0 indicates that the
     * dispatcher may bind to any available port.
     * </pre>
     *
     * <code>int64 port = 1;</code>
     */
    public long getPort() {
      return port_;
    }

    public static final int PROTOCOL_FIELD_NUMBER = 2;
    private volatile java.lang.Object protocol_;
    /**
     * <pre>
     * The protocol for the dispatcher to use when connecting to workers.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    public java.lang.String getProtocol() {
      java.lang.Object ref = protocol_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        protocol_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The protocol for the dispatcher to use when connecting to workers.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    public com.google.protobuf.ByteString
        getProtocolBytes() {
      java.lang.Object ref = protocol_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        protocol_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int WORK_DIR_FIELD_NUMBER = 3;
    private volatile java.lang.Object workDir_;
    /**
     * <pre>
     * A work directory to use for storing dispatcher state, and for recovering
     * during restarts. The empty string indicates not to use any work directory.
     * </pre>
     *
     * <code>string work_dir = 3;</code>
     */
    public java.lang.String getWorkDir() {
      java.lang.Object ref = workDir_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        workDir_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * A work directory to use for storing dispatcher state, and for recovering
     * during restarts. The empty string indicates not to use any work directory.
     * </pre>
     *
     * <code>string work_dir = 3;</code>
     */
    public com.google.protobuf.ByteString
        getWorkDirBytes() {
      java.lang.Object ref = workDir_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        workDir_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int FAULT_TOLERANT_MODE_FIELD_NUMBER = 4;
    private boolean faultTolerantMode_;
    /**
     * <pre>
     * Whether to run in fault tolerant mode, where dispatcher state is saved
     * across restarts. Requires that `work_dir` is nonempty.
     * </pre>
     *
     * <code>bool fault_tolerant_mode = 4;</code>
     */
    public boolean getFaultTolerantMode() {
      return faultTolerantMode_;
    }

    public static final int WORKER_ADDRESSES_FIELD_NUMBER = 7;
    private com.google.protobuf.LazyStringList workerAddresses_;
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getWorkerAddressesList() {
      return workerAddresses_;
    }
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    public int getWorkerAddressesCount() {
      return workerAddresses_.size();
    }
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    public java.lang.String getWorkerAddresses(int index) {
      return workerAddresses_.get(index);
    }
    /**
     * <pre>
     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
     * of worker addresses that will register with the dispatcher. The worker
     * addresses should be in the format "host" or "host:port", where "port" is an
     * integer, named port, or %port% to match any port.
     * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
     * allowed in the "COLOCATED" mode.
     * </pre>
     *
     * <code>repeated string worker_addresses = 7;</code>
     */
    public com.google.protobuf.ByteString
        getWorkerAddressesBytes(int index) {
      return workerAddresses_.getByteString(index);
    }

    public static final int JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER = 5;
    private long jobGcCheckIntervalMs_;
    /**
     * <pre>
     * How often the dispatcher should scan through to delete old and unused
     * jobs. A value of 0 indicates that the decision should be left up to the
     * runtime.
     * </pre>
     *
     * <code>int64 job_gc_check_interval_ms = 5;</code>
     */
    public long getJobGcCheckIntervalMs() {
      return jobGcCheckIntervalMs_;
    }

    public static final int JOB_GC_TIMEOUT_MS_FIELD_NUMBER = 6;
    private long jobGcTimeoutMs_;
    /**
     * <pre>
     * How long a job needs to be unused before it becomes a candidate for garbage
     * collection. A value of -1 indicates that jobs should never be garbage
     * collected. A value of 0 indicates that the decision should be left up to
     * the runtime.
     * </pre>
     *
     * <code>int64 job_gc_timeout_ms = 6;</code>
     */
    public long getJobGcTimeoutMs() {
      return jobGcTimeoutMs_;
    }

    public static final int CLIENT_TIMEOUT_MS_FIELD_NUMBER = 8;
    private long clientTimeoutMs_;
    /**
     * <pre>
     * How long to wait before garbage-collecting a client that hasn't
     * heartbeated to the dispatcher. A value of 0 indicates that the timeout
     * should be left to the runtime.
     * </pre>
     *
     * <code>int64 client_timeout_ms = 8;</code>
     */
    public long getClientTimeoutMs() {
      return clientTimeoutMs_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (port_ != 0L) {
        output.writeInt64(1, port_);
      }
      if (!getProtocolBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_);
      }
      if (!getWorkDirBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workDir_);
      }
      if (faultTolerantMode_ != false) {
        output.writeBool(4, faultTolerantMode_);
      }
      if (jobGcCheckIntervalMs_ != 0L) {
        output.writeInt64(5, jobGcCheckIntervalMs_);
      }
      if (jobGcTimeoutMs_ != 0L) {
        output.writeInt64(6, jobGcTimeoutMs_);
      }
      for (int i = 0; i < workerAddresses_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 7, workerAddresses_.getRaw(i));
      }
      if (clientTimeoutMs_ != 0L) {
        output.writeInt64(8, clientTimeoutMs_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (port_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(1, port_);
      }
      if (!getProtocolBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_);
      }
      if (!getWorkDirBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, workDir_);
      }
      if (faultTolerantMode_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(4, faultTolerantMode_);
      }
      if (jobGcCheckIntervalMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(5, jobGcCheckIntervalMs_);
      }
      if (jobGcTimeoutMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(6, jobGcTimeoutMs_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < workerAddresses_.size(); i++) {
          dataSize += computeStringSizeNoTag(workerAddresses_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getWorkerAddressesList().size();
      }
      if (clientTimeoutMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(8, clientTimeoutMs_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)) {
        return super.equals(obj);
      }
      org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) obj;

      if (getPort()
          != other.getPort()) return false;
      if (!getProtocol()
          .equals(other.getProtocol())) return false;
      if (!getWorkDir()
          .equals(other.getWorkDir())) return false;
      if (getFaultTolerantMode()
          != other.getFaultTolerantMode()) return false;
      if (!getWorkerAddressesList()
          .equals(other.getWorkerAddressesList())) return false;
      if (getJobGcCheckIntervalMs()
          != other.getJobGcCheckIntervalMs()) return false;
      if (getJobGcTimeoutMs()
          != other.getJobGcTimeoutMs()) return false;
      if (getClientTimeoutMs()
          != other.getClientTimeoutMs()) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + PORT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPort());
      hash = (37 * hash) + PROTOCOL_FIELD_NUMBER;
      hash = (53 * hash) + getProtocol().hashCode();
      hash = (37 * hash) + WORK_DIR_FIELD_NUMBER;
      hash = (53 * hash) + getWorkDir().hashCode();
      hash = (37 * hash) + FAULT_TOLERANT_MODE_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getFaultTolerantMode());
      if (getWorkerAddressesCount() > 0) {
        hash = (37 * hash) + WORKER_ADDRESSES_FIELD_NUMBER;
        hash = (53 * hash) + getWorkerAddressesList().hashCode();
      }
      hash = (37 * hash) + JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getJobGcCheckIntervalMs());
      hash = (37 * hash) + JOB_GC_TIMEOUT_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getJobGcTimeoutMs());
      hash = (37 * hash) + CLIENT_TIMEOUT_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getClientTimeoutMs());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * Configuration for a tf.data service DispatchServer.
     * Next id: 9
     * </pre>
     *
     * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.DispatcherConfig)
        org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfigOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class);
      }

      // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        port_ = 0L;

        protocol_ = "";

        workDir_ = "";

        faultTolerantMode_ = false;

        workerAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        jobGcCheckIntervalMs_ = 0L;

        jobGcTimeoutMs_ = 0L;

        clientTimeoutMs_ = 0L;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor;
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance();
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig build() {
        org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig buildPartial() {
        org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig(this);
        int from_bitField0_ = bitField0_;
        result.port_ = port_;
        result.protocol_ = protocol_;
        result.workDir_ = workDir_;
        result.faultTolerantMode_ = faultTolerantMode_;
        if (((bitField0_ & 0x00000001) != 0)) {
          workerAddresses_ = workerAddresses_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.workerAddresses_ = workerAddresses_;
        result.jobGcCheckIntervalMs_ = jobGcCheckIntervalMs_;
        result.jobGcTimeoutMs_ = jobGcTimeoutMs_;
        result.clientTimeoutMs_ = clientTimeoutMs_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }
      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return super.setField(field, value);
      }
      @java.lang.Override
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }
      @java.lang.Override
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }
      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }
      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }
      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) {
          return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other) {
        if (other == org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance()) return this;
        if (other.getPort() != 0L) {
          setPort(other.getPort());
        }
        if (!other.getProtocol().isEmpty()) {
          protocol_ = other.protocol_;
          onChanged();
        }
        if (!other.getWorkDir().isEmpty()) {
          workDir_ = other.workDir_;
          onChanged();
        }
        if (other.getFaultTolerantMode() != false) {
          setFaultTolerantMode(other.getFaultTolerantMode());
        }
        if (!other.workerAddresses_.isEmpty()) {
          if (workerAddresses_.isEmpty()) {
            workerAddresses_ = other.workerAddresses_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureWorkerAddressesIsMutable();
            workerAddresses_.addAll(other.workerAddresses_);
          }
          onChanged();
        }
        if (other.getJobGcCheckIntervalMs() != 0L) {
          setJobGcCheckIntervalMs(other.getJobGcCheckIntervalMs());
        }
        if (other.getJobGcTimeoutMs() != 0L) {
          setJobGcTimeoutMs(other.getJobGcTimeoutMs());
        }
        if (other.getClientTimeoutMs() != 0L) {
          setClientTimeoutMs(other.getClientTimeoutMs());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private long port_ ;
      /**
       * <pre>
       * The port for the dispatcher to bind to. A value of 0 indicates that the
       * dispatcher may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public long getPort() {
        return port_;
      }
      /**
       * <pre>
       * The port for the dispatcher to bind to. A value of 0 indicates that the
       * dispatcher may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public Builder setPort(long value) {
        
        port_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The port for the dispatcher to bind to. A value of 0 indicates that the
       * dispatcher may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public Builder clearPort() {
        
        port_ = 0L;
        onChanged();
        return this;
      }

      private java.lang.Object protocol_ = "";
      /**
       * <pre>
       * The protocol for the dispatcher to use when connecting to workers.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public java.lang.String getProtocol() {
        java.lang.Object ref = protocol_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          protocol_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the dispatcher to use when connecting to workers.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public com.google.protobuf.ByteString
          getProtocolBytes() {
        java.lang.Object ref = protocol_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          protocol_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the dispatcher to use when connecting to workers.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder setProtocol(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        protocol_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the dispatcher to use when connecting to workers.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder clearProtocol() {
        
        protocol_ = getDefaultInstance().getProtocol();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the dispatcher to use when connecting to workers.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder setProtocolBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        protocol_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object workDir_ = "";
      /**
       * <pre>
       * A work directory to use for storing dispatcher state, and for recovering
       * during restarts. The empty string indicates not to use any work directory.
       * </pre>
       *
       * <code>string work_dir = 3;</code>
       */
      public java.lang.String getWorkDir() {
        java.lang.Object ref = workDir_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          workDir_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * A work directory to use for storing dispatcher state, and for recovering
       * during restarts. The empty string indicates not to use any work directory.
       * </pre>
       *
       * <code>string work_dir = 3;</code>
       */
      public com.google.protobuf.ByteString
          getWorkDirBytes() {
        java.lang.Object ref = workDir_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          workDir_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * A work directory to use for storing dispatcher state, and for recovering
       * during restarts. The empty string indicates not to use any work directory.
       * </pre>
       *
       * <code>string work_dir = 3;</code>
       */
      public Builder setWorkDir(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        workDir_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * A work directory to use for storing dispatcher state, and for recovering
       * during restarts. The empty string indicates not to use any work directory.
       * </pre>
       *
       * <code>string work_dir = 3;</code>
       */
      public Builder clearWorkDir() {
        
        workDir_ = getDefaultInstance().getWorkDir();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * A work directory to use for storing dispatcher state, and for recovering
       * during restarts. The empty string indicates not to use any work directory.
       * </pre>
       *
       * <code>string work_dir = 3;</code>
       */
      public Builder setWorkDirBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        workDir_ = value;
        onChanged();
        return this;
      }

      private boolean faultTolerantMode_ ;
      /**
       * <pre>
       * Whether to run in fault tolerant mode, where dispatcher state is saved
       * across restarts. Requires that `work_dir` is nonempty.
       * </pre>
       *
       * <code>bool fault_tolerant_mode = 4;</code>
       */
      public boolean getFaultTolerantMode() {
        return faultTolerantMode_;
      }
      /**
       * <pre>
       * Whether to run in fault tolerant mode, where dispatcher state is saved
       * across restarts. Requires that `work_dir` is nonempty.
       * </pre>
       *
       * <code>bool fault_tolerant_mode = 4;</code>
       */
      public Builder setFaultTolerantMode(boolean value) {
        
        faultTolerantMode_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Whether to run in fault tolerant mode, where dispatcher state is saved
       * across restarts. Requires that `work_dir` is nonempty.
       * </pre>
       *
       * <code>bool fault_tolerant_mode = 4;</code>
       */
      public Builder clearFaultTolerantMode() {
        
        faultTolerantMode_ = false;
        onChanged();
        return this;
      }

      private com.google.protobuf.LazyStringList workerAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureWorkerAddressesIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          workerAddresses_ = new com.google.protobuf.LazyStringArrayList(workerAddresses_);
          bitField0_ |= 0x00000001;
         }
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public com.google.protobuf.ProtocolStringList
          getWorkerAddressesList() {
        return workerAddresses_.getUnmodifiableView();
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public int getWorkerAddressesCount() {
        return workerAddresses_.size();
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public java.lang.String getWorkerAddresses(int index) {
        return workerAddresses_.get(index);
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public com.google.protobuf.ByteString
          getWorkerAddressesBytes(int index) {
        return workerAddresses_.getByteString(index);
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public Builder setWorkerAddresses(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureWorkerAddressesIsMutable();
        workerAddresses_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public Builder addWorkerAddresses(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureWorkerAddressesIsMutable();
        workerAddresses_.add(value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public Builder addAllWorkerAddresses(
          java.lang.Iterable<java.lang.String> values) {
        ensureWorkerAddressesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, workerAddresses_);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public Builder clearWorkerAddresses() {
        workerAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
       * of worker addresses that will register with the dispatcher. The worker
       * addresses should be in the format "host" or "host:port", where "port" is an
       * integer, named port, or %port% to match any port.
       * TODO(yangchen): Also add a deployment mode flag. Auto-sharding will only be
       * allowed in the "COLOCATED" mode.
       * </pre>
       *
       * <code>repeated string worker_addresses = 7;</code>
       */
      public Builder addWorkerAddressesBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        ensureWorkerAddressesIsMutable();
        workerAddresses_.add(value);
        onChanged();
        return this;
      }

      private long jobGcCheckIntervalMs_ ;
      /**
       * <pre>
       * How often the dispatcher should scan through to delete old and unused
       * jobs. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 job_gc_check_interval_ms = 5;</code>
       */
      public long getJobGcCheckIntervalMs() {
        return jobGcCheckIntervalMs_;
      }
      /**
       * <pre>
       * How often the dispatcher should scan through to delete old and unused
       * jobs. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 job_gc_check_interval_ms = 5;</code>
       */
      public Builder setJobGcCheckIntervalMs(long value) {
        
        jobGcCheckIntervalMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * How often the dispatcher should scan through to delete old and unused
       * jobs. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 job_gc_check_interval_ms = 5;</code>
       */
      public Builder clearJobGcCheckIntervalMs() {
        
        jobGcCheckIntervalMs_ = 0L;
        onChanged();
        return this;
      }

      private long jobGcTimeoutMs_ ;
      /**
       * <pre>
       * How long a job needs to be unused before it becomes a candidate for garbage
       * collection. A value of -1 indicates that jobs should never be garbage
       * collected. A value of 0 indicates that the decision should be left up to
       * the runtime.
       * </pre>
       *
       * <code>int64 job_gc_timeout_ms = 6;</code>
       */
      public long getJobGcTimeoutMs() {
        return jobGcTimeoutMs_;
      }
      /**
       * <pre>
       * How long a job needs to be unused before it becomes a candidate for garbage
       * collection. A value of -1 indicates that jobs should never be garbage
       * collected. A value of 0 indicates that the decision should be left up to
       * the runtime.
       * </pre>
       *
       * <code>int64 job_gc_timeout_ms = 6;</code>
       */
      public Builder setJobGcTimeoutMs(long value) {
        
        jobGcTimeoutMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * How long a job needs to be unused before it becomes a candidate for garbage
       * collection. A value of -1 indicates that jobs should never be garbage
       * collected. A value of 0 indicates that the decision should be left up to
       * the runtime.
       * </pre>
       *
       * <code>int64 job_gc_timeout_ms = 6;</code>
       */
      public Builder clearJobGcTimeoutMs() {
        
        jobGcTimeoutMs_ = 0L;
        onChanged();
        return this;
      }

      private long clientTimeoutMs_ ;
      /**
       * <pre>
       * How long to wait before garbage-collecting a client that hasn't
       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
       * should be left to the runtime.
       * </pre>
       *
       * <code>int64 client_timeout_ms = 8;</code>
       */
      public long getClientTimeoutMs() {
        return clientTimeoutMs_;
      }
      /**
       * <pre>
       * How long to wait before garbage-collecting a client that hasn't
       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
       * should be left to the runtime.
       * </pre>
       *
       * <code>int64 client_timeout_ms = 8;</code>
       */
      public Builder setClientTimeoutMs(long value) {
        
        clientTimeoutMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * How long to wait before garbage-collecting a client that hasn't
       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
       * should be left to the runtime.
       * </pre>
       *
       * <code>int64 client_timeout_ms = 8;</code>
       */
      public Builder clearClientTimeoutMs() {
        
        clientTimeoutMs_ = 0L;
        onChanged();
        return this;
      }
      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.DispatcherConfig)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.DispatcherConfig)
    private static final org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig();
    }

    public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<DispatcherConfig>
        PARSER = new com.google.protobuf.AbstractParser<DispatcherConfig>() {
      @java.lang.Override
      public DispatcherConfig parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new DispatcherConfig(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<DispatcherConfig> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<DispatcherConfig> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface WorkerConfigOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.WorkerConfig)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The port for the worker to bind to. A value of 0 indicates that the
     * worker may bind to any available port.
     * </pre>
     *
     * <code>int64 port = 1;</code>
     */
    long getPort();

    /**
     * <pre>
     * The protocol for the worker to use when connecting to the dispatcher.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    java.lang.String getProtocol();
    /**
     * <pre>
     * The protocol for the worker to use when connecting to the dispatcher.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    com.google.protobuf.ByteString
        getProtocolBytes();

    /**
     * <pre>
     * The address of the dispatcher to register with.
     * </pre>
     *
     * <code>string dispatcher_address = 3;</code>
     */
    java.lang.String getDispatcherAddress();
    /**
     * <pre>
     * The address of the dispatcher to register with.
     * </pre>
     *
     * <code>string dispatcher_address = 3;</code>
     */
    com.google.protobuf.ByteString
        getDispatcherAddressBytes();

    /**
     * <pre>
     * The address of the worker server. The substring "%port%", if specified,
     * will be replaced with the worker's bound port. This is useful when the port
     * is set to `0`.
     * </pre>
     *
     * <code>string worker_address = 4;</code>
     */
    java.lang.String getWorkerAddress();
    /**
     * <pre>
     * The address of the worker server. The substring "%port%", if specified,
     * will be replaced with the worker's bound port. This is useful when the port
     * is set to `0`.
     * </pre>
     *
     * <code>string worker_address = 4;</code>
     */
    com.google.protobuf.ByteString
        getWorkerAddressBytes();

    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    java.util.List<java.lang.String>
        getWorkerTagsList();
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    int getWorkerTagsCount();
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    java.lang.String getWorkerTags(int index);
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    com.google.protobuf.ByteString
        getWorkerTagsBytes(int index);

    /**
     * <pre>
     * How often the worker should heartbeat to the master. A value of 0 indicates
     * that the decision should be left up to the runtime.
     * </pre>
     *
     * <code>int64 heartbeat_interval_ms = 5;</code>
     */
    long getHeartbeatIntervalMs();

    /**
     * <pre>
     * How long to retry requests to the dispatcher before giving up and reporting
     * an error. A value of 0 indicates that the decision should be left up to the
     * runtime.
     * </pre>
     *
     * <code>int64 dispatcher_timeout_ms = 6;</code>
     */
    long getDispatcherTimeoutMs();

    /**
     * <pre>
     * The protocol for the worker to use when transferring data to clients.
     * </pre>
     *
     * <code>string data_transfer_protocol = 7;</code>
     */
    java.lang.String getDataTransferProtocol();
    /**
     * <pre>
     * The protocol for the worker to use when transferring data to clients.
     * </pre>
     *
     * <code>string data_transfer_protocol = 7;</code>
     */
    com.google.protobuf.ByteString
        getDataTransferProtocolBytes();

    /**
     * <pre>
     * The data transfer address of the worker server. The substring "%port%", if
     * specified, will be replaced with the worker's bound port. This is useful
     * when the port is set to `0`.
     * </pre>
     *
     * <code>string data_transfer_address = 8;</code>
     */
    java.lang.String getDataTransferAddress();
    /**
     * <pre>
     * The data transfer address of the worker server. The substring "%port%", if
     * specified, will be replaced with the worker's bound port. This is useful
     * when the port is set to `0`.
     * </pre>
     *
     * <code>string data_transfer_address = 8;</code>
     */
    com.google.protobuf.ByteString
        getDataTransferAddressBytes();

    /**
     * <pre>
     * When shutting down a worker, how long to wait for the gRPC server to
     * process the final requests. This is used to achieve clean shutdown in unit
     * tests.
     * </pre>
     *
     * <code>int64 shutdown_quiet_period_ms = 9;</code>
     */
    long getShutdownQuietPeriodMs();
  }
  /**
   * <pre>
   * Configuration for a tf.data service WorkerServer.
   * Next id: 11
   * </pre>
   *
   * Protobuf type {@code tensorflow.data.experimental.WorkerConfig}
   */
  public  static final class WorkerConfig extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.WorkerConfig)
      WorkerConfigOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use WorkerConfig.newBuilder() to construct.
    private WorkerConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private WorkerConfig() {
      protocol_ = "";
      dispatcherAddress_ = "";
      workerAddress_ = "";
      workerTags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      dataTransferProtocol_ = "";
      dataTransferAddress_ = "";
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(
        UnusedPrivateParameter unused) {
      return new WorkerConfig();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private WorkerConfig(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 8: {

              port_ = input.readInt64();
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();

              protocol_ = s;
              break;
            }
            case 26: {
              java.lang.String s = input.readStringRequireUtf8();

              dispatcherAddress_ = s;
              break;
            }
            case 34: {
              java.lang.String s = input.readStringRequireUtf8();

              workerAddress_ = s;
              break;
            }
            case 40: {

              heartbeatIntervalMs_ = input.readInt64();
              break;
            }
            case 48: {

              dispatcherTimeoutMs_ = input.readInt64();
              break;
            }
            case 58: {
              java.lang.String s = input.readStringRequireUtf8();

              dataTransferProtocol_ = s;
              break;
            }
            case 66: {
              java.lang.String s = input.readStringRequireUtf8();

              dataTransferAddress_ = s;
              break;
            }
            case 72: {

              shutdownQuietPeriodMs_ = input.readInt64();
              break;
            }
            case 82: {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                workerTags_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000001;
              }
              workerTags_.add(s);
              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          workerTags_ = workerTags_.getUnmodifiableView();
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class);
    }

    public static final int PORT_FIELD_NUMBER = 1;
    private long port_;
    /**
     * <pre>
     * The port for the worker to bind to. A value of 0 indicates that the
     * worker may bind to any available port.
     * </pre>
     *
     * <code>int64 port = 1;</code>
     */
    public long getPort() {
      return port_;
    }

    public static final int PROTOCOL_FIELD_NUMBER = 2;
    private volatile java.lang.Object protocol_;
    /**
     * <pre>
     * The protocol for the worker to use when connecting to the dispatcher.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    public java.lang.String getProtocol() {
      java.lang.Object ref = protocol_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        protocol_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The protocol for the worker to use when connecting to the dispatcher.
     * </pre>
     *
     * <code>string protocol = 2;</code>
     */
    public com.google.protobuf.ByteString
        getProtocolBytes() {
      java.lang.Object ref = protocol_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        protocol_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DISPATCHER_ADDRESS_FIELD_NUMBER = 3;
    private volatile java.lang.Object dispatcherAddress_;
    /**
     * <pre>
     * The address of the dispatcher to register with.
     * </pre>
     *
     * <code>string dispatcher_address = 3;</code>
     */
    public java.lang.String getDispatcherAddress() {
      java.lang.Object ref = dispatcherAddress_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        dispatcherAddress_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The address of the dispatcher to register with.
     * </pre>
     *
     * <code>string dispatcher_address = 3;</code>
     */
    public com.google.protobuf.ByteString
        getDispatcherAddressBytes() {
      java.lang.Object ref = dispatcherAddress_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        dispatcherAddress_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int WORKER_ADDRESS_FIELD_NUMBER = 4;
    private volatile java.lang.Object workerAddress_;
    /**
     * <pre>
     * The address of the worker server. The substring "%port%", if specified,
     * will be replaced with the worker's bound port. This is useful when the port
     * is set to `0`.
     * </pre>
     *
     * <code>string worker_address = 4;</code>
     */
    public java.lang.String getWorkerAddress() {
      java.lang.Object ref = workerAddress_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        workerAddress_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The address of the worker server. The substring "%port%", if specified,
     * will be replaced with the worker's bound port. This is useful when the port
     * is set to `0`.
     * </pre>
     *
     * <code>string worker_address = 4;</code>
     */
    public com.google.protobuf.ByteString
        getWorkerAddressBytes() {
      java.lang.Object ref = workerAddress_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        workerAddress_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int WORKER_TAGS_FIELD_NUMBER = 10;
    private com.google.protobuf.LazyStringList workerTags_;
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getWorkerTagsList() {
      return workerTags_;
    }
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    public int getWorkerTagsCount() {
      return workerTags_.size();
    }
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    public java.lang.String getWorkerTags(int index) {
      return workerTags_.get(index);
    }
    /**
     * <pre>
     * Tags attached to the worker. This allows reading from selected workers.
     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
     * from the local tf.data worker if one exists, then from off-TF-host workers,
     * to avoid cross-TF-host reads.
     * </pre>
     *
     * <code>repeated string worker_tags = 10;</code>
     */
    public com.google.protobuf.ByteString
        getWorkerTagsBytes(int index) {
      return workerTags_.getByteString(index);
    }

    public static final int HEARTBEAT_INTERVAL_MS_FIELD_NUMBER = 5;
    private long heartbeatIntervalMs_;
    /**
     * <pre>
     * How often the worker should heartbeat to the master. A value of 0 indicates
     * that the decision should be left up to the runtime.
     * </pre>
     *
     * <code>int64 heartbeat_interval_ms = 5;</code>
     */
    public long getHeartbeatIntervalMs() {
      return heartbeatIntervalMs_;
    }

    public static final int DISPATCHER_TIMEOUT_MS_FIELD_NUMBER = 6;
    private long dispatcherTimeoutMs_;
    /**
     * <pre>
     * How long to retry requests to the dispatcher before giving up and reporting
     * an error. A value of 0 indicates that the decision should be left up to the
     * runtime.
     * </pre>
     *
     * <code>int64 dispatcher_timeout_ms = 6;</code>
     */
    public long getDispatcherTimeoutMs() {
      return dispatcherTimeoutMs_;
    }

    public static final int DATA_TRANSFER_PROTOCOL_FIELD_NUMBER = 7;
    private volatile java.lang.Object dataTransferProtocol_;
    /**
     * <pre>
     * The protocol for the worker to use when transferring data to clients.
     * </pre>
     *
     * <code>string data_transfer_protocol = 7;</code>
     */
    public java.lang.String getDataTransferProtocol() {
      java.lang.Object ref = dataTransferProtocol_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        dataTransferProtocol_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The protocol for the worker to use when transferring data to clients.
     * </pre>
     *
     * <code>string data_transfer_protocol = 7;</code>
     */
    public com.google.protobuf.ByteString
        getDataTransferProtocolBytes() {
      java.lang.Object ref = dataTransferProtocol_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        dataTransferProtocol_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DATA_TRANSFER_ADDRESS_FIELD_NUMBER = 8;
    private volatile java.lang.Object dataTransferAddress_;
    /**
     * <pre>
     * The data transfer address of the worker server. The substring "%port%", if
     * specified, will be replaced with the worker's bound port. This is useful
     * when the port is set to `0`.
     * </pre>
     *
     * <code>string data_transfer_address = 8;</code>
     */
    public java.lang.String getDataTransferAddress() {
      java.lang.Object ref = dataTransferAddress_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        dataTransferAddress_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The data transfer address of the worker server. The substring "%port%", if
     * specified, will be replaced with the worker's bound port. This is useful
     * when the port is set to `0`.
     * </pre>
     *
     * <code>string data_transfer_address = 8;</code>
     */
    public com.google.protobuf.ByteString
        getDataTransferAddressBytes() {
      java.lang.Object ref = dataTransferAddress_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        dataTransferAddress_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER = 9;
    private long shutdownQuietPeriodMs_;
    /**
     * <pre>
     * When shutting down a worker, how long to wait for the gRPC server to
     * process the final requests. This is used to achieve clean shutdown in unit
     * tests.
     * </pre>
     *
     * <code>int64 shutdown_quiet_period_ms = 9;</code>
     */
    public long getShutdownQuietPeriodMs() {
      return shutdownQuietPeriodMs_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (port_ != 0L) {
        output.writeInt64(1, port_);
      }
      if (!getProtocolBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_);
      }
      if (!getDispatcherAddressBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dispatcherAddress_);
      }
      if (!getWorkerAddressBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 4, workerAddress_);
      }
      if (heartbeatIntervalMs_ != 0L) {
        output.writeInt64(5, heartbeatIntervalMs_);
      }
      if (dispatcherTimeoutMs_ != 0L) {
        output.writeInt64(6, dispatcherTimeoutMs_);
      }
      if (!getDataTransferProtocolBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 7, dataTransferProtocol_);
      }
      if (!getDataTransferAddressBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 8, dataTransferAddress_);
      }
      if (shutdownQuietPeriodMs_ != 0L) {
        output.writeInt64(9, shutdownQuietPeriodMs_);
      }
      for (int i = 0; i < workerTags_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 10, workerTags_.getRaw(i));
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (port_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(1, port_);
      }
      if (!getProtocolBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_);
      }
      if (!getDispatcherAddressBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dispatcherAddress_);
      }
      if (!getWorkerAddressBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, workerAddress_);
      }
      if (heartbeatIntervalMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(5, heartbeatIntervalMs_);
      }
      if (dispatcherTimeoutMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(6, dispatcherTimeoutMs_);
      }
      if (!getDataTransferProtocolBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, dataTransferProtocol_);
      }
      if (!getDataTransferAddressBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, dataTransferAddress_);
      }
      if (shutdownQuietPeriodMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(9, shutdownQuietPeriodMs_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < workerTags_.size(); i++) {
          dataSize += computeStringSizeNoTag(workerTags_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getWorkerTagsList().size();
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)) {
        return super.equals(obj);
      }
      org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) obj;

      if (getPort()
          != other.getPort()) return false;
      if (!getProtocol()
          .equals(other.getProtocol())) return false;
      if (!getDispatcherAddress()
          .equals(other.getDispatcherAddress())) return false;
      if (!getWorkerAddress()
          .equals(other.getWorkerAddress())) return false;
      if (!getWorkerTagsList()
          .equals(other.getWorkerTagsList())) return false;
      if (getHeartbeatIntervalMs()
          != other.getHeartbeatIntervalMs()) return false;
      if (getDispatcherTimeoutMs()
          != other.getDispatcherTimeoutMs()) return false;
      if (!getDataTransferProtocol()
          .equals(other.getDataTransferProtocol())) return false;
      if (!getDataTransferAddress()
          .equals(other.getDataTransferAddress())) return false;
      if (getShutdownQuietPeriodMs()
          != other.getShutdownQuietPeriodMs()) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + PORT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPort());
      hash = (37 * hash) + PROTOCOL_FIELD_NUMBER;
      hash = (53 * hash) + getProtocol().hashCode();
      hash = (37 * hash) + DISPATCHER_ADDRESS_FIELD_NUMBER;
      hash = (53 * hash) + getDispatcherAddress().hashCode();
      hash = (37 * hash) + WORKER_ADDRESS_FIELD_NUMBER;
      hash = (53 * hash) + getWorkerAddress().hashCode();
      if (getWorkerTagsCount() > 0) {
        hash = (37 * hash) + WORKER_TAGS_FIELD_NUMBER;
        hash = (53 * hash) + getWorkerTagsList().hashCode();
      }
      hash = (37 * hash) + HEARTBEAT_INTERVAL_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getHeartbeatIntervalMs());
      hash = (37 * hash) + DISPATCHER_TIMEOUT_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getDispatcherTimeoutMs());
      hash = (37 * hash) + DATA_TRANSFER_PROTOCOL_FIELD_NUMBER;
      hash = (53 * hash) + getDataTransferProtocol().hashCode();
      hash = (37 * hash) + DATA_TRANSFER_ADDRESS_FIELD_NUMBER;
      hash = (53 * hash) + getDataTransferAddress().hashCode();
      hash = (37 * hash) + SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getShutdownQuietPeriodMs());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * Configuration for a tf.data service WorkerServer.
     * Next id: 11
     * </pre>
     *
     * Protobuf type {@code tensorflow.data.experimental.WorkerConfig}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.WorkerConfig)
        org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfigOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class);
      }

      // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        port_ = 0L;

        protocol_ = "";

        dispatcherAddress_ = "";

        workerAddress_ = "";

        workerTags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        heartbeatIntervalMs_ = 0L;

        dispatcherTimeoutMs_ = 0L;

        dataTransferProtocol_ = "";

        dataTransferAddress_ = "";

        shutdownQuietPeriodMs_ = 0L;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor;
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() {
        return org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance();
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig build() {
        org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig buildPartial() {
        org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig(this);
        int from_bitField0_ = bitField0_;
        result.port_ = port_;
        result.protocol_ = protocol_;
        result.dispatcherAddress_ = dispatcherAddress_;
        result.workerAddress_ = workerAddress_;
        if (((bitField0_ & 0x00000001) != 0)) {
          workerTags_ = workerTags_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.workerTags_ = workerTags_;
        result.heartbeatIntervalMs_ = heartbeatIntervalMs_;
        result.dispatcherTimeoutMs_ = dispatcherTimeoutMs_;
        result.dataTransferProtocol_ = dataTransferProtocol_;
        result.dataTransferAddress_ = dataTransferAddress_;
        result.shutdownQuietPeriodMs_ = shutdownQuietPeriodMs_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }
      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return super.setField(field, value);
      }
      @java.lang.Override
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }
      @java.lang.Override
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }
      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }
      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }
      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) {
          return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other) {
        if (other == org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance()) return this;
        if (other.getPort() != 0L) {
          setPort(other.getPort());
        }
        if (!other.getProtocol().isEmpty()) {
          protocol_ = other.protocol_;
          onChanged();
        }
        if (!other.getDispatcherAddress().isEmpty()) {
          dispatcherAddress_ = other.dispatcherAddress_;
          onChanged();
        }
        if (!other.getWorkerAddress().isEmpty()) {
          workerAddress_ = other.workerAddress_;
          onChanged();
        }
        if (!other.workerTags_.isEmpty()) {
          if (workerTags_.isEmpty()) {
            workerTags_ = other.workerTags_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureWorkerTagsIsMutable();
            workerTags_.addAll(other.workerTags_);
          }
          onChanged();
        }
        if (other.getHeartbeatIntervalMs() != 0L) {
          setHeartbeatIntervalMs(other.getHeartbeatIntervalMs());
        }
        if (other.getDispatcherTimeoutMs() != 0L) {
          setDispatcherTimeoutMs(other.getDispatcherTimeoutMs());
        }
        if (!other.getDataTransferProtocol().isEmpty()) {
          dataTransferProtocol_ = other.dataTransferProtocol_;
          onChanged();
        }
        if (!other.getDataTransferAddress().isEmpty()) {
          dataTransferAddress_ = other.dataTransferAddress_;
          onChanged();
        }
        if (other.getShutdownQuietPeriodMs() != 0L) {
          setShutdownQuietPeriodMs(other.getShutdownQuietPeriodMs());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private long port_ ;
      /**
       * <pre>
       * The port for the worker to bind to. A value of 0 indicates that the
       * worker may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public long getPort() {
        return port_;
      }
      /**
       * <pre>
       * The port for the worker to bind to. A value of 0 indicates that the
       * worker may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public Builder setPort(long value) {
        
        port_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The port for the worker to bind to. A value of 0 indicates that the
       * worker may bind to any available port.
       * </pre>
       *
       * <code>int64 port = 1;</code>
       */
      public Builder clearPort() {
        
        port_ = 0L;
        onChanged();
        return this;
      }

      private java.lang.Object protocol_ = "";
      /**
       * <pre>
       * The protocol for the worker to use when connecting to the dispatcher.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public java.lang.String getProtocol() {
        java.lang.Object ref = protocol_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          protocol_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the worker to use when connecting to the dispatcher.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public com.google.protobuf.ByteString
          getProtocolBytes() {
        java.lang.Object ref = protocol_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          protocol_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the worker to use when connecting to the dispatcher.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder setProtocol(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        protocol_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the worker to use when connecting to the dispatcher.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder clearProtocol() {
        
        protocol_ = getDefaultInstance().getProtocol();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the worker to use when connecting to the dispatcher.
       * </pre>
       *
       * <code>string protocol = 2;</code>
       */
      public Builder setProtocolBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        protocol_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object dispatcherAddress_ = "";
      /**
       * <pre>
       * The address of the dispatcher to register with.
       * </pre>
       *
       * <code>string dispatcher_address = 3;</code>
       */
      public java.lang.String getDispatcherAddress() {
        java.lang.Object ref = dispatcherAddress_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          dispatcherAddress_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The address of the dispatcher to register with.
       * </pre>
       *
       * <code>string dispatcher_address = 3;</code>
       */
      public com.google.protobuf.ByteString
          getDispatcherAddressBytes() {
        java.lang.Object ref = dispatcherAddress_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          dispatcherAddress_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The address of the dispatcher to register with.
       * </pre>
       *
       * <code>string dispatcher_address = 3;</code>
       */
      public Builder setDispatcherAddress(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        dispatcherAddress_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The address of the dispatcher to register with.
       * </pre>
       *
       * <code>string dispatcher_address = 3;</code>
       */
      public Builder clearDispatcherAddress() {
        
        dispatcherAddress_ = getDefaultInstance().getDispatcherAddress();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The address of the dispatcher to register with.
       * </pre>
       *
       * <code>string dispatcher_address = 3;</code>
       */
      public Builder setDispatcherAddressBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        dispatcherAddress_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object workerAddress_ = "";
      /**
       * <pre>
       * The address of the worker server. The substring "%port%", if specified,
       * will be replaced with the worker's bound port. This is useful when the port
       * is set to `0`.
       * </pre>
       *
       * <code>string worker_address = 4;</code>
       */
      public java.lang.String getWorkerAddress() {
        java.lang.Object ref = workerAddress_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          workerAddress_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The address of the worker server. The substring "%port%", if specified,
       * will be replaced with the worker's bound port. This is useful when the port
       * is set to `0`.
       * </pre>
       *
       * <code>string worker_address = 4;</code>
       */
      public com.google.protobuf.ByteString
          getWorkerAddressBytes() {
        java.lang.Object ref = workerAddress_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          workerAddress_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The address of the worker server. The substring "%port%", if specified,
       * will be replaced with the worker's bound port. This is useful when the port
       * is set to `0`.
       * </pre>
       *
       * <code>string worker_address = 4;</code>
       */
      public Builder setWorkerAddress(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        workerAddress_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The address of the worker server. The substring "%port%", if specified,
       * will be replaced with the worker's bound port. This is useful when the port
       * is set to `0`.
       * </pre>
       *
       * <code>string worker_address = 4;</code>
       */
      public Builder clearWorkerAddress() {
        
        workerAddress_ = getDefaultInstance().getWorkerAddress();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The address of the worker server. The substring "%port%", if specified,
       * will be replaced with the worker's bound port. This is useful when the port
       * is set to `0`.
       * </pre>
       *
       * <code>string worker_address = 4;</code>
       */
      public Builder setWorkerAddressBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        workerAddress_ = value;
        onChanged();
        return this;
      }

      private com.google.protobuf.LazyStringList workerTags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureWorkerTagsIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          workerTags_ = new com.google.protobuf.LazyStringArrayList(workerTags_);
          bitField0_ |= 0x00000001;
         }
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public com.google.protobuf.ProtocolStringList
          getWorkerTagsList() {
        return workerTags_.getUnmodifiableView();
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public int getWorkerTagsCount() {
        return workerTags_.size();
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public java.lang.String getWorkerTags(int index) {
        return workerTags_.get(index);
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public com.google.protobuf.ByteString
          getWorkerTagsBytes(int index) {
        return workerTags_.getByteString(index);
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public Builder setWorkerTags(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureWorkerTagsIsMutable();
        workerTags_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public Builder addWorkerTags(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureWorkerTagsIsMutable();
        workerTags_.add(value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public Builder addAllWorkerTags(
          java.lang.Iterable<java.lang.String> values) {
        ensureWorkerTagsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, workerTags_);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public Builder clearWorkerTags() {
        workerTags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Tags attached to the worker. This allows reading from selected workers.
       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
       * from the local tf.data worker if one exists, then from off-TF-host workers,
       * to avoid cross-TF-host reads.
       * </pre>
       *
       * <code>repeated string worker_tags = 10;</code>
       */
      public Builder addWorkerTagsBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        ensureWorkerTagsIsMutable();
        workerTags_.add(value);
        onChanged();
        return this;
      }

      private long heartbeatIntervalMs_ ;
      /**
       * <pre>
       * How often the worker should heartbeat to the master. A value of 0 indicates
       * that the decision should be left up to the runtime.
       * </pre>
       *
       * <code>int64 heartbeat_interval_ms = 5;</code>
       */
      public long getHeartbeatIntervalMs() {
        return heartbeatIntervalMs_;
      }
      /**
       * <pre>
       * How often the worker should heartbeat to the master. A value of 0 indicates
       * that the decision should be left up to the runtime.
       * </pre>
       *
       * <code>int64 heartbeat_interval_ms = 5;</code>
       */
      public Builder setHeartbeatIntervalMs(long value) {
        
        heartbeatIntervalMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * How often the worker should heartbeat to the master. A value of 0 indicates
       * that the decision should be left up to the runtime.
       * </pre>
       *
       * <code>int64 heartbeat_interval_ms = 5;</code>
       */
      public Builder clearHeartbeatIntervalMs() {
        
        heartbeatIntervalMs_ = 0L;
        onChanged();
        return this;
      }

      private long dispatcherTimeoutMs_ ;
      /**
       * <pre>
       * How long to retry requests to the dispatcher before giving up and reporting
       * an error. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 dispatcher_timeout_ms = 6;</code>
       */
      public long getDispatcherTimeoutMs() {
        return dispatcherTimeoutMs_;
      }
      /**
       * <pre>
       * How long to retry requests to the dispatcher before giving up and reporting
       * an error. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 dispatcher_timeout_ms = 6;</code>
       */
      public Builder setDispatcherTimeoutMs(long value) {
        
        dispatcherTimeoutMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * How long to retry requests to the dispatcher before giving up and reporting
       * an error. A value of 0 indicates that the decision should be left up to the
       * runtime.
       * </pre>
       *
       * <code>int64 dispatcher_timeout_ms = 6;</code>
       */
      public Builder clearDispatcherTimeoutMs() {
        
        dispatcherTimeoutMs_ = 0L;
        onChanged();
        return this;
      }

      private java.lang.Object dataTransferProtocol_ = "";
      /**
       * <pre>
       * The protocol for the worker to use when transferring data to clients.
       * </pre>
       *
       * <code>string data_transfer_protocol = 7;</code>
       */
      public java.lang.String getDataTransferProtocol() {
        java.lang.Object ref = dataTransferProtocol_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          dataTransferProtocol_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the worker to use when transferring data to clients.
       * </pre>
       *
       * <code>string data_transfer_protocol = 7;</code>
       */
      public com.google.protobuf.ByteString
          getDataTransferProtocolBytes() {
        java.lang.Object ref = dataTransferProtocol_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          dataTransferProtocol_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The protocol for the worker to use when transferring data to clients.
       * </pre>
       *
       * <code>string data_transfer_protocol = 7;</code>
       */
      public Builder setDataTransferProtocol(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        dataTransferProtocol_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the worker to use when transferring data to clients.
       * </pre>
       *
       * <code>string data_transfer_protocol = 7;</code>
       */
      public Builder clearDataTransferProtocol() {
        
        dataTransferProtocol_ = getDefaultInstance().getDataTransferProtocol();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The protocol for the worker to use when transferring data to clients.
       * </pre>
       *
       * <code>string data_transfer_protocol = 7;</code>
       */
      public Builder setDataTransferProtocolBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        dataTransferProtocol_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object dataTransferAddress_ = "";
      /**
       * <pre>
       * The data transfer address of the worker server. The substring "%port%", if
       * specified, will be replaced with the worker's bound port. This is useful
       * when the port is set to `0`.
       * </pre>
       *
       * <code>string data_transfer_address = 8;</code>
       */
      public java.lang.String getDataTransferAddress() {
        java.lang.Object ref = dataTransferAddress_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          dataTransferAddress_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The data transfer address of the worker server. The substring "%port%", if
       * specified, will be replaced with the worker's bound port. This is useful
       * when the port is set to `0`.
       * </pre>
       *
       * <code>string data_transfer_address = 8;</code>
       */
      public com.google.protobuf.ByteString
          getDataTransferAddressBytes() {
        java.lang.Object ref = dataTransferAddress_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          dataTransferAddress_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The data transfer address of the worker server. The substring "%port%", if
       * specified, will be replaced with the worker's bound port. This is useful
       * when the port is set to `0`.
       * </pre>
       *
       * <code>string data_transfer_address = 8;</code>
       */
      public Builder setDataTransferAddress(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        dataTransferAddress_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The data transfer address of the worker server. The substring "%port%", if
       * specified, will be replaced with the worker's bound port. This is useful
       * when the port is set to `0`.
       * </pre>
       *
       * <code>string data_transfer_address = 8;</code>
       */
      public Builder clearDataTransferAddress() {
        
        dataTransferAddress_ = getDefaultInstance().getDataTransferAddress();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The data transfer address of the worker server. The substring "%port%", if
       * specified, will be replaced with the worker's bound port. This is useful
       * when the port is set to `0`.
       * </pre>
       *
       * <code>string data_transfer_address = 8;</code>
       */
      public Builder setDataTransferAddressBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        dataTransferAddress_ = value;
        onChanged();
        return this;
      }

      private long shutdownQuietPeriodMs_ ;
      /**
       * <pre>
       * When shutting down a worker, how long to wait for the gRPC server to
       * process the final requests. This is used to achieve clean shutdown in unit
       * tests.
       * </pre>
       *
       * <code>int64 shutdown_quiet_period_ms = 9;</code>
       */
      public long getShutdownQuietPeriodMs() {
        return shutdownQuietPeriodMs_;
      }
      /**
       * <pre>
       * When shutting down a worker, how long to wait for the gRPC server to
       * process the final requests. This is used to achieve clean shutdown in unit
       * tests.
       * </pre>
       *
       * <code>int64 shutdown_quiet_period_ms = 9;</code>
       */
      public Builder setShutdownQuietPeriodMs(long value) {
        
        shutdownQuietPeriodMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * When shutting down a worker, how long to wait for the gRPC server to
       * process the final requests. This is used to achieve clean shutdown in unit
       * tests.
       * </pre>
       *
       * <code>int64 shutdown_quiet_period_ms = 9;</code>
       */
      public Builder clearShutdownQuietPeriodMs() {
        
        shutdownQuietPeriodMs_ = 0L;
        onChanged();
        return this;
      }
      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.WorkerConfig)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.WorkerConfig)
    private static final org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig();
    }

    public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<WorkerConfig>
        PARSER = new com.google.protobuf.AbstractParser<WorkerConfig>() {
      @java.lang.Override
      public WorkerConfig parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new WorkerConfig(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<WorkerConfig> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<WorkerConfig> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_data_experimental_WorkerConfig_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n-tensorflow/core/protobuf/service_confi" +
      "g.proto\022\034tensorflow.data.experimental\"\323\001" +
      "\n\020DispatcherConfig\022\014\n\004port\030\001 \001(\003\022\020\n\010prot" +
      "ocol\030\002 \001(\t\022\020\n\010work_dir\030\003 \001(\t\022\033\n\023fault_to" +
      "lerant_mode\030\004 \001(\010\022\030\n\020worker_addresses\030\007 " +
      "\003(\t\022 \n\030job_gc_check_interval_ms\030\005 \001(\003\022\031\n" +
      "\021job_gc_timeout_ms\030\006 \001(\003\022\031\n\021client_timeo" +
      "ut_ms\030\010 \001(\003\"\226\002\n\014WorkerConfig\022\014\n\004port\030\001 \001" +
      "(\003\022\020\n\010protocol\030\002 \001(\t\022\032\n\022dispatcher_addre" +
      "ss\030\003 \001(\t\022\026\n\016worker_address\030\004 \001(\t\022\023\n\013work" +
      "er_tags\030\n \003(\t\022\035\n\025heartbeat_interval_ms\030\005" +
      " \001(\003\022\035\n\025dispatcher_timeout_ms\030\006 \001(\003\022\036\n\026d" +
      "ata_transfer_protocol\030\007 \001(\t\022\035\n\025data_tran" +
      "sfer_address\030\010 \001(\t\022 \n\030shutdown_quiet_per" +
      "iod_ms\030\t \001(\003B\177\n&org.tensorflow.proto.dat" +
      "a.experimentalZUgithub.com/tensorflow/te" +
      "nsorflow/tensorflow/go/core/protobuf/for" +
      "_core_protos_go_protob\006proto3"
    };
    descriptor = com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        });
    internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor,
        new java.lang.String[] { "Port", "Protocol", "WorkDir", "FaultTolerantMode", "WorkerAddresses", "JobGcCheckIntervalMs", "JobGcTimeoutMs", "ClientTimeoutMs", });
    internal_static_tensorflow_data_experimental_WorkerConfig_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_data_experimental_WorkerConfig_descriptor,
        new java.lang.String[] { "Port", "Protocol", "DispatcherAddress", "WorkerAddress", "WorkerTags", "HeartbeatIntervalMs", "DispatcherTimeoutMs", "DataTransferProtocol", "DataTransferAddress", "ShutdownQuietPeriodMs", });
  }

  // @@protoc_insertion_point(outer_class_scope)
}
