Class ResourceRequirements.Builder (0.18.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ResourceRequirements.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

build()

public ResourceRequirements build()
Returns
TypeDescription
ResourceRequirements

buildPartial()

public ResourceRequirements buildPartial()
Returns
TypeDescription
ResourceRequirements

clear()

public ResourceRequirements.Builder clear()
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

clearCpuIdle()

public ResourceRequirements.Builder clearCpuIdle()

Determines whether CPU should be throttled or not outside of requests.

bool cpu_idle = 2;

Returns
TypeDescription
ResourceRequirements.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ResourceRequirements.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

clearLimits()

public ResourceRequirements.Builder clearLimits()
Returns
TypeDescription
ResourceRequirements.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ResourceRequirements.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
ResourceRequirements.Builder

This builder for chaining.

clone()

public ResourceRequirements.Builder clone()
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

containsLimits(String key)

public boolean containsLimits(String key)

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getCpuIdle()

public boolean getCpuIdle()

Determines whether CPU should be throttled or not outside of requests.

bool cpu_idle = 2;

Returns
TypeDescription
boolean

The cpuIdle.

getDefaultInstanceForType()

public ResourceRequirements getDefaultInstanceForType()
Returns
TypeDescription
ResourceRequirements

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLimits()

public Map<String,String> getLimits()

Use #getLimitsMap() instead.

Returns
TypeDescription
Map<String,String>

getLimitsCount()

public int getLimitsCount()

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Returns
TypeDescription
int

getLimitsMap()

public Map<String,String> getLimitsMap()

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Returns
TypeDescription
Map<String,String>

getLimitsOrDefault(String key, String defaultValue)

public String getLimitsOrDefault(String key, String defaultValue)

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLimitsOrThrow(String key)

public String getLimitsOrThrow(String key)

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLimits()

public Map<String,String> getMutableLimits()

Use alternate mutation accessors instead.

Returns
TypeDescription
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
TypeDescription
boolean

The startupCpuBoost.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ResourceRequirements other)

public ResourceRequirements.Builder mergeFrom(ResourceRequirements other)
Parameter
NameDescription
otherResourceRequirements
Returns
TypeDescription
ResourceRequirements.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ResourceRequirements.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ResourceRequirements.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ResourceRequirements.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ResourceRequirements.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

putAllLimits(Map<String,String> values)

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

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
ResourceRequirements.Builder

putLimits(String key, String value)

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

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
ResourceRequirements.Builder

removeLimits(String key)

public ResourceRequirements.Builder removeLimits(String key)

Only ´memory´ and 'cpu' are supported. <p>Notes:

map<string, string> limits = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
ResourceRequirements.Builder

setCpuIdle(boolean value)

public ResourceRequirements.Builder setCpuIdle(boolean value)

Determines whether CPU should be throttled or not outside of requests.

bool cpu_idle = 2;

Parameter
NameDescription
valueboolean

The cpuIdle to set.

Returns
TypeDescription
ResourceRequirements.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ResourceRequirements.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ResourceRequirements.Builder
Overrides

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

public ResourceRequirements.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueboolean

The startupCpuBoost to set.

Returns
TypeDescription
ResourceRequirements.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ResourceRequirements.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ResourceRequirements.Builder
Overrides