Class ResourceSpecification (0.6.0)

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

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()
Returns
Type Description
ResourceSpecification

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ResourceSpecification.Builder newBuilder()
Returns
Type Description
ResourceSpecification.Builder

newBuilder(ResourceSpecification prototype)

public static ResourceSpecification.Builder newBuilder(ResourceSpecification prototype)
Parameter
Name Description
prototype ResourceSpecification
Returns
Type Description
ResourceSpecification.Builder

parseDelimitedFrom(InputStream input)

public static ResourceSpecification parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ResourceSpecification parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ResourceSpecification parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ResourceSpecification parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ResourceSpecification parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ResourceSpecification parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ResourceSpecification parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceSpecification
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ResourceSpecification> parser()
Returns
Type Description
Parser<ResourceSpecification>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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;

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()
Returns
Type Description
ResourceSpecification

getGpus()

public int 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()
Returns
Type Description
Parser<ResourceSpecification>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ResourceSpecification.Builder newBuilderForType()
Returns
Type Description
ResourceSpecification.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ResourceSpecification.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ResourceSpecification.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ResourceSpecification.Builder toBuilder()
Returns
Type Description
ResourceSpecification.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException