Class ResourceRequirements.Builder (0.44.0)

public static final class ResourceRequirements.Builder extends GeneratedMessageV3.Builder<ResourceRequirements.Builder> implements ResourceRequirementsOrBuilder

ResourceRequirements describes the compute resource requirements.

Protobuf type google.cloud.run.v2.ResourceRequirements

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ResourceRequirements.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ResourceRequirements.Builder
Overrides

build()

public ResourceRequirements build()
Returns
Type Description
ResourceRequirements

buildPartial()

public ResourceRequirements buildPartial()
Returns
Type Description
ResourceRequirements

clear()

public ResourceRequirements.Builder clear()
Returns
Type Description
ResourceRequirements.Builder
Overrides

clearCpuIdle()

public ResourceRequirements.Builder clearCpuIdle()

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;

Returns
Type Description
ResourceRequirements.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ResourceRequirements.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ResourceRequirements.Builder
Overrides

clearLimits()

public ResourceRequirements.Builder clearLimits()
Returns
Type Description
ResourceRequirements.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ResourceRequirements.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ResourceRequirements.Builder
Overrides

clearStartupCpuBoost()

public ResourceRequirements.Builder clearStartupCpuBoost()

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;

Returns
Type Description
ResourceRequirements.Builder

This builder for chaining.

clone()

public ResourceRequirements.Builder clone()
Returns
Type Description
ResourceRequirements.Builder
Overrides

containsLimits(String key)

public boolean containsLimits(String key)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameter
Name Description
key String
Returns
Type Description
boolean

getCpuIdle()

public 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;

Returns
Type Description
boolean

The cpuIdle.

getDefaultInstanceForType()

public ResourceRequirements getDefaultInstanceForType()
Returns
Type Description
ResourceRequirements

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLimits() (deprecated)

public Map<String,String> getLimits()

Use #getLimitsMap() instead.

Returns
Type Description
Map<String,String>

getLimitsCount()

public int getLimitsCount()

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Returns
Type Description
int

getLimitsMap()

public Map<String,String> getLimitsMap()

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Returns
Type Description
Map<String,String>

getLimitsOrDefault(String key, String defaultValue)

public String getLimitsOrDefault(String key, String defaultValue)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLimitsOrThrow(String key)

public String getLimitsOrThrow(String key)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameter
Name Description
key String
Returns
Type Description
String

getMutableLimits() (deprecated)

public Map<String,String> getMutableLimits()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getStartupCpuBoost()

public 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;

Returns
Type Description
boolean

The startupCpuBoost.

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ResourceRequirements other)

public ResourceRequirements.Builder mergeFrom(ResourceRequirements other)
Parameter
Name Description
other ResourceRequirements
Returns
Type Description
ResourceRequirements.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ResourceRequirements.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceRequirements.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ResourceRequirements.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ResourceRequirements.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ResourceRequirements.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ResourceRequirements.Builder
Overrides

putAllLimits(Map<String,String> values)

public ResourceRequirements.Builder putAllLimits(Map<String,String> values)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
ResourceRequirements.Builder

putLimits(String key, String value)

public ResourceRequirements.Builder putLimits(String key, String value)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameters
Name Description
key String
value String
Returns
Type Description
ResourceRequirements.Builder

removeLimits(String key)

public ResourceRequirements.Builder removeLimits(String key)

Only memory and cpu keys in the map are supported.

<p>Notes:

map<string, string> limits = 1;

Parameter
Name Description
key String
Returns
Type Description
ResourceRequirements.Builder

setCpuIdle(boolean value)

public ResourceRequirements.Builder setCpuIdle(boolean value)

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;

Parameter
Name Description
value boolean

The cpuIdle to set.

Returns
Type Description
ResourceRequirements.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ResourceRequirements.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ResourceRequirements.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ResourceRequirements.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ResourceRequirements.Builder
Overrides

setStartupCpuBoost(boolean value)

public ResourceRequirements.Builder setStartupCpuBoost(boolean value)

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;

Parameter
Name Description
value boolean

The startupCpuBoost to set.

Returns
Type Description
ResourceRequirements.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ResourceRequirements.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ResourceRequirements.Builder
Overrides