public final class ResourceRequirements extends com.google.protobuf.GeneratedMessageV3 implements ResourceRequirementsOrBuilder
ResourceRequirements describes the compute resource requirements.Protobuf type
google.cloud.run.v2.ResourceRequirements| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceRequirements.Builder
ResourceRequirements describes the compute resource requirements.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CPU_IDLE_FIELD_NUMBER |
static int |
LIMITS_FIELD_NUMBER |
static int |
STARTUP_CPU_BOOST_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsLimits(String key)
Only `memory` and `cpu` keys in the map are supported.
|
boolean |
equals(Object obj) |
boolean |
getCpuIdle()
Determines whether CPU is only allocated during requests (true by default).
|
static ResourceRequirements |
getDefaultInstance() |
ResourceRequirements |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
Map<String,String> |
getLimits()
Deprecated.
|
int |
getLimitsCount()
Only `memory` and `cpu` keys in the map are supported.
|
Map<String,String> |
getLimitsMap()
Only `memory` and `cpu` keys in the map are supported.
|
String |
getLimitsOrDefault(String key,
String defaultValue)
Only `memory` and `cpu` keys in the map are supported.
|
String |
getLimitsOrThrow(String key)
Only `memory` and `cpu` keys in the map are supported.
|
com.google.protobuf.Parser<ResourceRequirements> |
getParserForType() |
int |
getSerializedSize() |
boolean |
getStartupCpuBoost()
Determines whether CPU should be boosted on startup of a new container
instance above the requested CPU threshold, this can help reduce cold-start
latency.
|
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapFieldReflectionAccessor |
internalGetMapFieldReflection(int number) |
boolean |
isInitialized() |
static ResourceRequirements.Builder |
newBuilder() |
static ResourceRequirements.Builder |
newBuilder(ResourceRequirements prototype) |
ResourceRequirements.Builder |
newBuilderForType() |
protected ResourceRequirements.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static ResourceRequirements |
parseDelimitedFrom(InputStream input) |
static ResourceRequirements |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceRequirements |
parseFrom(byte[] data) |
static ResourceRequirements |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceRequirements |
parseFrom(ByteBuffer data) |
static ResourceRequirements |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceRequirements |
parseFrom(com.google.protobuf.ByteString data) |
static ResourceRequirements |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceRequirements |
parseFrom(com.google.protobuf.CodedInputStream input) |
static ResourceRequirements |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceRequirements |
parseFrom(InputStream input) |
static ResourceRequirements |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<ResourceRequirements> |
parser() |
ResourceRequirements.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int LIMITS_FIELD_NUMBER
public static final int CPU_IDLE_FIELD_NUMBER
public static final int STARTUP_CPU_BOOST_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessageV3protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public int getLimitsCount()
ResourceRequirementsOrBuilderOnly `memory` and `cpu` keys in the map are supported. <p>Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits
map<string, string> limits = 1;getLimitsCount in interface ResourceRequirementsOrBuilderpublic boolean containsLimits(String key)
Only `memory` and `cpu` keys in the map are supported. <p>Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits
map<string, string> limits = 1;containsLimits in interface ResourceRequirementsOrBuilder@Deprecated public Map<String,String> getLimits()
getLimitsMap() instead.getLimits in interface ResourceRequirementsOrBuilderpublic Map<String,String> getLimitsMap()
Only `memory` and `cpu` keys in the map are supported. <p>Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits
map<string, string> limits = 1;getLimitsMap in interface ResourceRequirementsOrBuilderpublic String getLimitsOrDefault(String key, String defaultValue)
Only `memory` and `cpu` keys in the map are supported. <p>Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits
map<string, string> limits = 1;getLimitsOrDefault in interface ResourceRequirementsOrBuilderpublic String getLimitsOrThrow(String key)
Only `memory` and `cpu` keys in the map are supported. <p>Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits
map<string, string> limits = 1;getLimitsOrThrow in interface ResourceRequirementsOrBuilderpublic boolean getCpuIdle()
Determines whether CPU is only allocated during requests (true by default). However, if ResourceRequirements is set, the caller must explicitly set this field to true to preserve the default behavior.
bool cpu_idle = 2;getCpuIdle in interface ResourceRequirementsOrBuilderpublic boolean getStartupCpuBoost()
Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
bool startup_cpu_boost = 3;getStartupCpuBoost in interface ResourceRequirementsOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static ResourceRequirements parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceRequirements parseFrom(InputStream input) throws IOException
IOExceptionpublic static ResourceRequirements parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ResourceRequirements parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static ResourceRequirements parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ResourceRequirements parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static ResourceRequirements parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic ResourceRequirements.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static ResourceRequirements.Builder newBuilder()
public static ResourceRequirements.Builder newBuilder(ResourceRequirements prototype)
public ResourceRequirements.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected ResourceRequirements.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static ResourceRequirements getDefaultInstance()
public static com.google.protobuf.Parser<ResourceRequirements> parser()
public com.google.protobuf.Parser<ResourceRequirements> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public ResourceRequirements getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.