Class ServiceConfig.DispatcherConfig.Builder

All Implemented Interfaces:
Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, Cloneable, ServiceConfig.DispatcherConfigOrBuilder
Enclosing class:
ServiceConfig.DispatcherConfig

public static final class ServiceConfig.DispatcherConfig.Builder extends GeneratedMessage.Builder<ServiceConfig.DispatcherConfig.Builder> implements ServiceConfig.DispatcherConfigOrBuilder
Configuration for a tf.data service DispatchServer.
Next id: 13
Protobuf type tensorflow.data.experimental.DispatcherConfig
  • Method Details

    • getDescriptor

      public static final Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

    • clear

      Specified by:
      clear in interface Message.Builder
      Specified by:
      clear in interface MessageLite.Builder
      Overrides:
      clear in class GeneratedMessage.Builder<ServiceConfig.DispatcherConfig.Builder>
    • getDescriptorForType

      public Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface Message.Builder
      Specified by:
      getDescriptorForType in interface MessageOrBuilder
      Overrides:
      getDescriptorForType in class GeneratedMessage.Builder<ServiceConfig.DispatcherConfig.Builder>
    • getDefaultInstanceForType

      public ServiceConfig.DispatcherConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface MessageOrBuilder
    • build

      Specified by:
      build in interface Message.Builder
      Specified by:
      build in interface MessageLite.Builder
    • buildPartial

      public ServiceConfig.DispatcherConfig buildPartial()
      Specified by:
      buildPartial in interface Message.Builder
      Specified by:
      buildPartial in interface MessageLite.Builder
    • mergeFrom

    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface MessageLiteOrBuilder
      Overrides:
      isInitialized in class GeneratedMessage.Builder<ServiceConfig.DispatcherConfig.Builder>
    • mergeFrom

      Specified by:
      mergeFrom in interface Message.Builder
      Specified by:
      mergeFrom in interface MessageLite.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<ServiceConfig.DispatcherConfig.Builder>
      Throws:
      IOException
    • getPort

      public long getPort()
      The port for the dispatcher to bind to. A value of 0 indicates that the
      dispatcher may bind to any available port.
      
      int64 port = 1;
      Specified by:
      getPort in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The port.
    • setPort

      public ServiceConfig.DispatcherConfig.Builder setPort(long value)
      The port for the dispatcher to bind to. A value of 0 indicates that the
      dispatcher may bind to any available port.
      
      int64 port = 1;
      Parameters:
      value - The port to set.
      Returns:
      This builder for chaining.
    • clearPort

      The port for the dispatcher to bind to. A value of 0 indicates that the
      dispatcher may bind to any available port.
      
      int64 port = 1;
      Returns:
      This builder for chaining.
    • getProtocol

      public String getProtocol()
      The protocol for the dispatcher to use when connecting to workers.
      
      string protocol = 2;
      Specified by:
      getProtocol in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The protocol.
    • getProtocolBytes

      public ByteString getProtocolBytes()
      The protocol for the dispatcher to use when connecting to workers.
      
      string protocol = 2;
      Specified by:
      getProtocolBytes in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The bytes for protocol.
    • setProtocol

      public ServiceConfig.DispatcherConfig.Builder setProtocol(String value)
      The protocol for the dispatcher to use when connecting to workers.
      
      string protocol = 2;
      Parameters:
      value - The protocol to set.
      Returns:
      This builder for chaining.
    • clearProtocol

      The protocol for the dispatcher to use when connecting to workers.
      
      string protocol = 2;
      Returns:
      This builder for chaining.
    • setProtocolBytes

      public ServiceConfig.DispatcherConfig.Builder setProtocolBytes(ByteString value)
      The protocol for the dispatcher to use when connecting to workers.
      
      string protocol = 2;
      Parameters:
      value - The bytes for protocol to set.
      Returns:
      This builder for chaining.
    • getWorkDir

      public String getWorkDir()
      A work directory to use for storing dispatcher state, and for recovering
      during restarts. The empty string indicates not to use any work directory.
      
      string work_dir = 3;
      Specified by:
      getWorkDir in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The workDir.
    • getWorkDirBytes

      public ByteString getWorkDirBytes()
      A work directory to use for storing dispatcher state, and for recovering
      during restarts. The empty string indicates not to use any work directory.
      
      string work_dir = 3;
      Specified by:
      getWorkDirBytes in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The bytes for workDir.
    • setWorkDir

      A work directory to use for storing dispatcher state, and for recovering
      during restarts. The empty string indicates not to use any work directory.
      
      string work_dir = 3;
      Parameters:
      value - The workDir to set.
      Returns:
      This builder for chaining.
    • clearWorkDir

      A work directory to use for storing dispatcher state, and for recovering
      during restarts. The empty string indicates not to use any work directory.
      
      string work_dir = 3;
      Returns:
      This builder for chaining.
    • setWorkDirBytes

      public ServiceConfig.DispatcherConfig.Builder setWorkDirBytes(ByteString value)
      A work directory to use for storing dispatcher state, and for recovering
      during restarts. The empty string indicates not to use any work directory.
      
      string work_dir = 3;
      Parameters:
      value - The bytes for workDir to set.
      Returns:
      This builder for chaining.
    • getFaultTolerantMode

      public boolean getFaultTolerantMode()
      Whether to run in fault tolerant mode, where dispatcher state is saved
      across restarts. Requires that `work_dir` is nonempty.
      
      bool fault_tolerant_mode = 4;
      Specified by:
      getFaultTolerantMode in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The faultTolerantMode.
    • setFaultTolerantMode

      public ServiceConfig.DispatcherConfig.Builder setFaultTolerantMode(boolean value)
      Whether to run in fault tolerant mode, where dispatcher state is saved
      across restarts. Requires that `work_dir` is nonempty.
      
      bool fault_tolerant_mode = 4;
      Parameters:
      value - The faultTolerantMode to set.
      Returns:
      This builder for chaining.
    • clearFaultTolerantMode

      public ServiceConfig.DispatcherConfig.Builder clearFaultTolerantMode()
      Whether to run in fault tolerant mode, where dispatcher state is saved
      across restarts. Requires that `work_dir` is nonempty.
      
      bool fault_tolerant_mode = 4;
      Returns:
      This builder for chaining.
    • getWorkerAddressesList

      public ProtocolStringList getWorkerAddressesList()
      (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.
      
      repeated string worker_addresses = 7;
      Specified by:
      getWorkerAddressesList in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      A list containing the workerAddresses.
    • getWorkerAddressesCount

      public int getWorkerAddressesCount()
      (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.
      
      repeated string worker_addresses = 7;
      Specified by:
      getWorkerAddressesCount in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The count of workerAddresses.
    • getWorkerAddresses

      public String getWorkerAddresses(int index)
      (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.
      
      repeated string worker_addresses = 7;
      Specified by:
      getWorkerAddresses in interface ServiceConfig.DispatcherConfigOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The workerAddresses at the given index.
    • getWorkerAddressesBytes

      public ByteString getWorkerAddressesBytes(int index)
      (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.
      
      repeated string worker_addresses = 7;
      Specified by:
      getWorkerAddressesBytes in interface ServiceConfig.DispatcherConfigOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the workerAddresses at the given index.
    • setWorkerAddresses

      public ServiceConfig.DispatcherConfig.Builder setWorkerAddresses(int index, String value)
      (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.
      
      repeated string worker_addresses = 7;
      Parameters:
      index - The index to set the value at.
      value - The workerAddresses to set.
      Returns:
      This builder for chaining.
    • addWorkerAddresses

      public ServiceConfig.DispatcherConfig.Builder addWorkerAddresses(String value)
      (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.
      
      repeated string worker_addresses = 7;
      Parameters:
      value - The workerAddresses to add.
      Returns:
      This builder for chaining.
    • addAllWorkerAddresses

      public ServiceConfig.DispatcherConfig.Builder addAllWorkerAddresses(Iterable<String> values)
      (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.
      
      repeated string worker_addresses = 7;
      Parameters:
      values - The workerAddresses to add.
      Returns:
      This builder for chaining.
    • clearWorkerAddresses

      public ServiceConfig.DispatcherConfig.Builder clearWorkerAddresses()
      (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.
      
      repeated string worker_addresses = 7;
      Returns:
      This builder for chaining.
    • addWorkerAddressesBytes

      public ServiceConfig.DispatcherConfig.Builder addWorkerAddressesBytes(ByteString value)
      (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.
      
      repeated string worker_addresses = 7;
      Parameters:
      value - The bytes of the workerAddresses to add.
      Returns:
      This builder for chaining.
    • getDeploymentModeValue

      public int getDeploymentModeValue()
      (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
      "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
      
      .tensorflow.data.DeploymentMode deployment_mode = 9;
      Specified by:
      getDeploymentModeValue in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The enum numeric value on the wire for deploymentMode.
    • setDeploymentModeValue

      public ServiceConfig.DispatcherConfig.Builder setDeploymentModeValue(int value)
      (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
      "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
      
      .tensorflow.data.DeploymentMode deployment_mode = 9;
      Parameters:
      value - The enum numeric value on the wire for deploymentMode to set.
      Returns:
      This builder for chaining.
    • getDeploymentMode

      public DataService.DeploymentMode getDeploymentMode()
      (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
      "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
      
      .tensorflow.data.DeploymentMode deployment_mode = 9;
      Specified by:
      getDeploymentMode in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The deploymentMode.
    • setDeploymentMode

      (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
      "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
      
      .tensorflow.data.DeploymentMode deployment_mode = 9;
      Parameters:
      value - The deploymentMode to set.
      Returns:
      This builder for chaining.
    • clearDeploymentMode

      public ServiceConfig.DispatcherConfig.Builder clearDeploymentMode()
      (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
      "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
      
      .tensorflow.data.DeploymentMode deployment_mode = 9;
      Returns:
      This builder for chaining.
    • getJobGcCheckIntervalMs

      public long getJobGcCheckIntervalMs()
      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.
      
      int64 job_gc_check_interval_ms = 5;
      Specified by:
      getJobGcCheckIntervalMs in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The jobGcCheckIntervalMs.
    • setJobGcCheckIntervalMs

      public ServiceConfig.DispatcherConfig.Builder setJobGcCheckIntervalMs(long value)
      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.
      
      int64 job_gc_check_interval_ms = 5;
      Parameters:
      value - The jobGcCheckIntervalMs to set.
      Returns:
      This builder for chaining.
    • clearJobGcCheckIntervalMs

      public ServiceConfig.DispatcherConfig.Builder clearJobGcCheckIntervalMs()
      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.
      
      int64 job_gc_check_interval_ms = 5;
      Returns:
      This builder for chaining.
    • getJobGcTimeoutMs

      public long getJobGcTimeoutMs()
      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. Note: This does not apply to dynamic sharding unless users
      explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
      
      int64 job_gc_timeout_ms = 6;
      Specified by:
      getJobGcTimeoutMs in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The jobGcTimeoutMs.
    • setJobGcTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder setJobGcTimeoutMs(long value)
      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. Note: This does not apply to dynamic sharding unless users
      explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
      
      int64 job_gc_timeout_ms = 6;
      Parameters:
      value - The jobGcTimeoutMs to set.
      Returns:
      This builder for chaining.
    • clearJobGcTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder clearJobGcTimeoutMs()
      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. Note: This does not apply to dynamic sharding unless users
      explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
      
      int64 job_gc_timeout_ms = 6;
      Returns:
      This builder for chaining.
    • getGcDynamicShardingJobs

      public boolean getGcDynamicShardingJobs()
      Whether dynamically sharded jobs should be eligible for garbage collection.
      These jobs are not garbage collected by default, since if a job is garbage
      collected and then re-created, it will revisit all data from the start. If
      revisiting data is acceptible and you want automatic reclamation of
      iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
      
      bool gc_dynamic_sharding_jobs = 11;
      Specified by:
      getGcDynamicShardingJobs in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The gcDynamicShardingJobs.
    • setGcDynamicShardingJobs

      public ServiceConfig.DispatcherConfig.Builder setGcDynamicShardingJobs(boolean value)
      Whether dynamically sharded jobs should be eligible for garbage collection.
      These jobs are not garbage collected by default, since if a job is garbage
      collected and then re-created, it will revisit all data from the start. If
      revisiting data is acceptible and you want automatic reclamation of
      iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
      
      bool gc_dynamic_sharding_jobs = 11;
      Parameters:
      value - The gcDynamicShardingJobs to set.
      Returns:
      This builder for chaining.
    • clearGcDynamicShardingJobs

      public ServiceConfig.DispatcherConfig.Builder clearGcDynamicShardingJobs()
      Whether dynamically sharded jobs should be eligible for garbage collection.
      These jobs are not garbage collected by default, since if a job is garbage
      collected and then re-created, it will revisit all data from the start. If
      revisiting data is acceptible and you want automatic reclamation of
      iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
      
      bool gc_dynamic_sharding_jobs = 11;
      Returns:
      This builder for chaining.
    • getClientTimeoutMs

      public long getClientTimeoutMs()
      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.
      
      int64 client_timeout_ms = 8;
      Specified by:
      getClientTimeoutMs in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The clientTimeoutMs.
    • setClientTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder setClientTimeoutMs(long value)
      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.
      
      int64 client_timeout_ms = 8;
      Parameters:
      value - The clientTimeoutMs to set.
      Returns:
      This builder for chaining.
    • clearClientTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder clearClientTimeoutMs()
      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.
      
      int64 client_timeout_ms = 8;
      Returns:
      This builder for chaining.
    • getWorkerTimeoutMs

      public long getWorkerTimeoutMs()
      How long to wait for a worker to heartbeat before considering it missing.
      A value of 0 indicates that the timeout should be left to the runtime.
      
      int64 worker_timeout_ms = 10;
      Specified by:
      getWorkerTimeoutMs in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The workerTimeoutMs.
    • setWorkerTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder setWorkerTimeoutMs(long value)
      How long to wait for a worker to heartbeat before considering it missing.
      A value of 0 indicates that the timeout should be left to the runtime.
      
      int64 worker_timeout_ms = 10;
      Parameters:
      value - The workerTimeoutMs to set.
      Returns:
      This builder for chaining.
    • clearWorkerTimeoutMs

      public ServiceConfig.DispatcherConfig.Builder clearWorkerTimeoutMs()
      How long to wait for a worker to heartbeat before considering it missing.
      A value of 0 indicates that the timeout should be left to the runtime.
      
      int64 worker_timeout_ms = 10;
      Returns:
      This builder for chaining.
    • getWorkerMaxConcurrentSnapshots

      public long getWorkerMaxConcurrentSnapshots()
      The maximum number of snapshots that a worker can concurrently process at a
      given point in time. This is a tradeoff between worker resource usage and
      snapshot wall time. A value of 0 indicates that the decision should be left
      up to the runtime.
      
      int64 worker_max_concurrent_snapshots = 12;
      Specified by:
      getWorkerMaxConcurrentSnapshots in interface ServiceConfig.DispatcherConfigOrBuilder
      Returns:
      The workerMaxConcurrentSnapshots.
    • setWorkerMaxConcurrentSnapshots

      public ServiceConfig.DispatcherConfig.Builder setWorkerMaxConcurrentSnapshots(long value)
      The maximum number of snapshots that a worker can concurrently process at a
      given point in time. This is a tradeoff between worker resource usage and
      snapshot wall time. A value of 0 indicates that the decision should be left
      up to the runtime.
      
      int64 worker_max_concurrent_snapshots = 12;
      Parameters:
      value - The workerMaxConcurrentSnapshots to set.
      Returns:
      This builder for chaining.
    • clearWorkerMaxConcurrentSnapshots

      public ServiceConfig.DispatcherConfig.Builder clearWorkerMaxConcurrentSnapshots()
      The maximum number of snapshots that a worker can concurrently process at a
      given point in time. This is a tradeoff between worker resource usage and
      snapshot wall time. A value of 0 indicates that the decision should be left
      up to the runtime.
      
      int64 worker_max_concurrent_snapshots = 12;
      Returns:
      This builder for chaining.