Class ResourceSpecification.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
com.google.cloud.visionai.v1.ResourceSpecification.Builder
All Implemented Interfaces:
ResourceSpecificationOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ResourceSpecification

public static final class ResourceSpecification.Builder extends com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder> implements ResourceSpecificationOrBuilder
 ResourceSpec collects a set of resources that can
 be used to specify requests and requirements.

 Note: Highly experimental as this can be runtime dependent.
 Can use the "extras" field to experiment first before trying
 to abstract it.
 
Protobuf type google.cloud.visionai.v1.ResourceSpecification
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
    • getDefaultInstanceForType

      public ResourceSpecification getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public ResourceSpecification build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public ResourceSpecification buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public ResourceSpecification.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceSpecification.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
    • mergeFrom

      public ResourceSpecification.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceSpecification.Builder>
      Throws:
      IOException
    • getCpu

      public String getCpu()
       CPU specification.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to let the system decide.
      
       Note that this does *not* determine the cpu vender/make,
       or its underlying clock speed and specific SIMD features.
       It is only the amount time it requires in timeslicing.
       
      string cpu = 1;
      Specified by:
      getCpu in interface ResourceSpecificationOrBuilder
      Returns:
      The cpu.
    • getCpuBytes

      public com.google.protobuf.ByteString getCpuBytes()
       CPU specification.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to let the system decide.
      
       Note that this does *not* determine the cpu vender/make,
       or its underlying clock speed and specific SIMD features.
       It is only the amount time it requires in timeslicing.
       
      string cpu = 1;
      Specified by:
      getCpuBytes in interface ResourceSpecificationOrBuilder
      Returns:
      The bytes for cpu.
    • setCpu

      public ResourceSpecification.Builder setCpu(String value)
       CPU specification.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to let the system decide.
      
       Note that this does *not* determine the cpu vender/make,
       or its underlying clock speed and specific SIMD features.
       It is only the amount time it requires in timeslicing.
       
      string cpu = 1;
      Parameters:
      value - The cpu to set.
      Returns:
      This builder for chaining.
    • clearCpu

      public ResourceSpecification.Builder clearCpu()
       CPU specification.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to let the system decide.
      
       Note that this does *not* determine the cpu vender/make,
       or its underlying clock speed and specific SIMD features.
       It is only the amount time it requires in timeslicing.
       
      string cpu = 1;
      Returns:
      This builder for chaining.
    • setCpuBytes

      public ResourceSpecification.Builder setCpuBytes(com.google.protobuf.ByteString value)
       CPU specification.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to let the system decide.
      
       Note that this does *not* determine the cpu vender/make,
       or its underlying clock speed and specific SIMD features.
       It is only the amount time it requires in timeslicing.
       
      string cpu = 1;
      Parameters:
      value - The bytes for cpu to set.
      Returns:
      This builder for chaining.
    • getCpuLimits

      public String getCpuLimits()
       CPU limit.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to indicate no limit.
       
      string cpu_limits = 5;
      Specified by:
      getCpuLimits in interface ResourceSpecificationOrBuilder
      Returns:
      The cpuLimits.
    • getCpuLimitsBytes

      public com.google.protobuf.ByteString getCpuLimitsBytes()
       CPU limit.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to indicate no limit.
       
      string cpu_limits = 5;
      Specified by:
      getCpuLimitsBytes in interface ResourceSpecificationOrBuilder
      Returns:
      The bytes for cpuLimits.
    • setCpuLimits

      public ResourceSpecification.Builder setCpuLimits(String value)
       CPU limit.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to indicate no limit.
       
      string cpu_limits = 5;
      Parameters:
      value - The cpuLimits to set.
      Returns:
      This builder for chaining.
    • clearCpuLimits

      public ResourceSpecification.Builder clearCpuLimits()
       CPU limit.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to indicate no limit.
       
      string cpu_limits = 5;
      Returns:
      This builder for chaining.
    • setCpuLimitsBytes

      public ResourceSpecification.Builder setCpuLimitsBytes(com.google.protobuf.ByteString value)
       CPU limit.
      
       Examples:
       "100m", "0.5", "1", "2", ... correspond to
       0.1, half, 1, or 2 cpus.
      
       Leave empty to indicate no limit.
       
      string cpu_limits = 5;
      Parameters:
      value - The bytes for cpuLimits to set.
      Returns:
      This builder for chaining.
    • getMemory

      public String getMemory()
       Memory specification (in bytes).
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to let the system decide.
       
      string memory = 2;
      Specified by:
      getMemory in interface ResourceSpecificationOrBuilder
      Returns:
      The memory.
    • getMemoryBytes

      public com.google.protobuf.ByteString getMemoryBytes()
       Memory specification (in bytes).
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to let the system decide.
       
      string memory = 2;
      Specified by:
      getMemoryBytes in interface ResourceSpecificationOrBuilder
      Returns:
      The bytes for memory.
    • setMemory

      public ResourceSpecification.Builder setMemory(String value)
       Memory specification (in bytes).
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to let the system decide.
       
      string memory = 2;
      Parameters:
      value - The memory to set.
      Returns:
      This builder for chaining.
    • clearMemory

      public ResourceSpecification.Builder clearMemory()
       Memory specification (in bytes).
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to let the system decide.
       
      string memory = 2;
      Returns:
      This builder for chaining.
    • setMemoryBytes

      public ResourceSpecification.Builder setMemoryBytes(com.google.protobuf.ByteString value)
       Memory specification (in bytes).
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to let the system decide.
       
      string memory = 2;
      Parameters:
      value - The bytes for memory to set.
      Returns:
      This builder for chaining.
    • getMemoryLimits

      public String getMemoryLimits()
       Memory usage limits.
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to indicate no limit.
       
      string memory_limits = 6;
      Specified by:
      getMemoryLimits in interface ResourceSpecificationOrBuilder
      Returns:
      The memoryLimits.
    • getMemoryLimitsBytes

      public com.google.protobuf.ByteString getMemoryLimitsBytes()
       Memory usage limits.
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to indicate no limit.
       
      string memory_limits = 6;
      Specified by:
      getMemoryLimitsBytes in interface ResourceSpecificationOrBuilder
      Returns:
      The bytes for memoryLimits.
    • setMemoryLimits

      public ResourceSpecification.Builder setMemoryLimits(String value)
       Memory usage limits.
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to indicate no limit.
       
      string memory_limits = 6;
      Parameters:
      value - The memoryLimits to set.
      Returns:
      This builder for chaining.
    • clearMemoryLimits

      public ResourceSpecification.Builder clearMemoryLimits()
       Memory usage limits.
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to indicate no limit.
       
      string memory_limits = 6;
      Returns:
      This builder for chaining.
    • setMemoryLimitsBytes

      public ResourceSpecification.Builder setMemoryLimitsBytes(com.google.protobuf.ByteString value)
       Memory usage limits.
      
       Examples:
       "128974848", "129e6", "129M", "123Mi", ... correspond to
       128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
      
       Leave empty to indicate no limit.
       
      string memory_limits = 6;
      Parameters:
      value - The bytes for memoryLimits to set.
      Returns:
      This builder for chaining.
    • getGpus

      public int getGpus()
       Number of gpus.
       
      int32 gpus = 3;
      Specified by:
      getGpus in interface ResourceSpecificationOrBuilder
      Returns:
      The gpus.
    • setGpus

      public ResourceSpecification.Builder setGpus(int value)
       Number of gpus.
       
      int32 gpus = 3;
      Parameters:
      value - The gpus to set.
      Returns:
      This builder for chaining.
    • clearGpus

      public ResourceSpecification.Builder clearGpus()
       Number of gpus.
       
      int32 gpus = 3;
      Returns:
      This builder for chaining.
    • getLatencyBudgetMs

      public int getLatencyBudgetMs()
       The maximum latency that this operator may use to process an element.
      
       If non positive, then a system default will be used.
       Operator developers should arrange for the system compute resources to be
       aligned with this latency budget; e.g. if you want a ML model to produce
       results within 500ms, then you should make sure you request enough
       cpu/gpu/memory to achieve that.
       
      int32 latency_budget_ms = 4;
      Specified by:
      getLatencyBudgetMs in interface ResourceSpecificationOrBuilder
      Returns:
      The latencyBudgetMs.
    • setLatencyBudgetMs

      public ResourceSpecification.Builder setLatencyBudgetMs(int value)
       The maximum latency that this operator may use to process an element.
      
       If non positive, then a system default will be used.
       Operator developers should arrange for the system compute resources to be
       aligned with this latency budget; e.g. if you want a ML model to produce
       results within 500ms, then you should make sure you request enough
       cpu/gpu/memory to achieve that.
       
      int32 latency_budget_ms = 4;
      Parameters:
      value - The latencyBudgetMs to set.
      Returns:
      This builder for chaining.
    • clearLatencyBudgetMs

      public ResourceSpecification.Builder clearLatencyBudgetMs()
       The maximum latency that this operator may use to process an element.
      
       If non positive, then a system default will be used.
       Operator developers should arrange for the system compute resources to be
       aligned with this latency budget; e.g. if you want a ML model to produce
       results within 500ms, then you should make sure you request enough
       cpu/gpu/memory to achieve that.
       
      int32 latency_budget_ms = 4;
      Returns:
      This builder for chaining.