Package com.google.cloud.visionai.v1
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 Summary
Modifier and TypeMethodDescriptionbuild()clear()clearCpu()CPU specification.CPU limit.Number of gpus.The maximum latency that this operator may use to process an element.Memory specification (in bytes).Memory usage limits.getCpu()CPU specification.com.google.protobuf.ByteStringCPU specification.CPU limit.com.google.protobuf.ByteStringCPU limit.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintgetGpus()Number of gpus.intThe maximum latency that this operator may use to process an element.Memory specification (in bytes).com.google.protobuf.ByteStringMemory specification (in bytes).Memory usage limits.com.google.protobuf.ByteStringMemory usage limits.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(ResourceSpecification other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) CPU specification.setCpuBytes(com.google.protobuf.ByteString value) CPU specification.setCpuLimits(String value) CPU limit.setCpuLimitsBytes(com.google.protobuf.ByteString value) CPU limit.setGpus(int value) Number of gpus.setLatencyBudgetMs(int value) The maximum latency that this operator may use to process an element.Memory specification (in bytes).setMemoryBytes(com.google.protobuf.ByteString value) Memory specification (in bytes).setMemoryLimits(String value) Memory usage limits.setMemoryLimitsBytes(com.google.protobuf.ByteString value) Memory usage limits.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<ResourceSpecification.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ResourceSpecification.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ResourceSpecification.Builder>- Throws:
IOException
-
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:
getCpuin interfaceResourceSpecificationOrBuilder- 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:
getCpuBytesin interfaceResourceSpecificationOrBuilder- Returns:
- The bytes for cpu.
-
setCpu
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
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
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
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:
getCpuLimitsin interfaceResourceSpecificationOrBuilder- 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:
getCpuLimitsBytesin interfaceResourceSpecificationOrBuilder- Returns:
- The bytes for cpuLimits.
-
setCpuLimits
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
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
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
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:
getMemoryin interfaceResourceSpecificationOrBuilder- 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:
getMemoryBytesin interfaceResourceSpecificationOrBuilder- Returns:
- The bytes for memory.
-
setMemory
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
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
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
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:
getMemoryLimitsin interfaceResourceSpecificationOrBuilder- 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:
getMemoryLimitsBytesin interfaceResourceSpecificationOrBuilder- Returns:
- The bytes for memoryLimits.
-
setMemoryLimits
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
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
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:
getGpusin interfaceResourceSpecificationOrBuilder- Returns:
- The gpus.
-
setGpus
Number of gpus.
int32 gpus = 3;- Parameters:
value- The gpus to set.- Returns:
- This builder for chaining.
-
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:
getLatencyBudgetMsin interfaceResourceSpecificationOrBuilder- Returns:
- The latencyBudgetMs.
-
setLatencyBudgetMs
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
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.
-