public final class ResourceSpecification extends GeneratedMessageV3 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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
CPU_FIELD_NUMBER
public static final int CPU_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
CPU_LIMITS_FIELD_NUMBER
public static final int CPU_LIMITS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
GPUS_FIELD_NUMBER
public static final int GPUS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
LATENCY_BUDGET_MS_FIELD_NUMBER
public static final int LATENCY_BUDGET_MS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
MEMORY_FIELD_NUMBER
public static final int MEMORY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
MEMORY_LIMITS_FIELD_NUMBER
public static final int MEMORY_LIMITS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static ResourceSpecification getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static ResourceSpecification.Builder newBuilder()
newBuilder(ResourceSpecification prototype)
public static ResourceSpecification.Builder newBuilder(ResourceSpecification prototype)
public static ResourceSpecification parseDelimitedFrom(InputStream input)
public static ResourceSpecification parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static ResourceSpecification parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static ResourceSpecification parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static ResourceSpecification parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ResourceSpecification parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ResourceSpecification parseFrom(CodedInputStream input)
public static ResourceSpecification parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static ResourceSpecification parseFrom(InputStream input)
public static ResourceSpecification parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static ResourceSpecification parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static ResourceSpecification parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<ResourceSpecification> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
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;
Returns |
Type |
Description |
String |
The cpu.
|
getCpuBytes()
public 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;
Returns |
Type |
Description |
ByteString |
The bytes for cpu.
|
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;
Returns |
Type |
Description |
String |
The cpuLimits.
|
getCpuLimitsBytes()
public 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;
Returns |
Type |
Description |
ByteString |
The bytes for cpuLimits.
|
getDefaultInstanceForType()
public ResourceSpecification getDefaultInstanceForType()
getGpus()
Number of gpus.
int32 gpus = 3;
Returns |
Type |
Description |
int |
The gpus.
|
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;
Returns |
Type |
Description |
int |
The latencyBudgetMs.
|
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;
Returns |
Type |
Description |
String |
The memory.
|
getMemoryBytes()
public 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;
Returns |
Type |
Description |
ByteString |
The bytes for memory.
|
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;
Returns |
Type |
Description |
String |
The memoryLimits.
|
getMemoryLimitsBytes()
public 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;
Returns |
Type |
Description |
ByteString |
The bytes for memoryLimits.
|
getParserForType()
public Parser<ResourceSpecification> getParserForType()
Overrides
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public ResourceSpecification.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected ResourceSpecification.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public ResourceSpecification.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides