Class AutoscalingPolicy (4.44.0)

public final class AutoscalingPolicy extends GeneratedMessageV3 implements AutoscalingPolicyOrBuilder

Describes an autoscaling policy for Dataproc cluster autoscaler.

Protobuf type google.cloud.dataproc.v1.AutoscalingPolicy

Static Fields

BASIC_ALGORITHM_FIELD_NUMBER

public static final int BASIC_ALGORITHM_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

SECONDARY_WORKER_CONFIG_FIELD_NUMBER

public static final int SECONDARY_WORKER_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

WORKER_CONFIG_FIELD_NUMBER

public static final int WORKER_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static AutoscalingPolicy getDefaultInstance()
Returns
Type Description
AutoscalingPolicy

getDescriptor()

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

newBuilder()

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

newBuilder(AutoscalingPolicy prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

containsLabels(String key)

public boolean containsLabels(String key)

Optional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035. Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with an autoscaling policy.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

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

getAlgorithmCase()

public AutoscalingPolicy.AlgorithmCase getAlgorithmCase()
Returns
Type Description
AutoscalingPolicy.AlgorithmCase

getBasicAlgorithm()

public BasicAutoscalingAlgorithm getBasicAlgorithm()

.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
BasicAutoscalingAlgorithm

The basicAlgorithm.

getBasicAlgorithmOrBuilder()

public BasicAutoscalingAlgorithmOrBuilder getBasicAlgorithmOrBuilder()

.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
BasicAutoscalingAlgorithmOrBuilder

getDefaultInstanceForType()

public AutoscalingPolicy getDefaultInstanceForType()
Returns
Type Description
AutoscalingPolicy

getId()

public String getId()

Required. The policy id.

The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters.

string id = 1;

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Required. The policy id.

The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters.

string id = 1;

Returns
Type Description
ByteString

The bytes for id.

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035. Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with an autoscaling policy.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035. Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with an autoscaling policy.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035. Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with an autoscaling policy.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035. Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with an autoscaling policy.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getName()

public String getName()

Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

string name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

string name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<AutoscalingPolicy> getParserForType()
Returns
Type Description
Parser<AutoscalingPolicy>
Overrides

getSecondaryWorkerConfig()

public InstanceGroupAutoscalingPolicyConfig getSecondaryWorkerConfig()

Optional. Describes how the autoscaler will operate for secondary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
InstanceGroupAutoscalingPolicyConfig

The secondaryWorkerConfig.

getSecondaryWorkerConfigOrBuilder()

public InstanceGroupAutoscalingPolicyConfigOrBuilder getSecondaryWorkerConfigOrBuilder()

Optional. Describes how the autoscaler will operate for secondary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
InstanceGroupAutoscalingPolicyConfigOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getWorkerConfig()

public InstanceGroupAutoscalingPolicyConfig getWorkerConfig()

Required. Describes how the autoscaler will operate for primary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
InstanceGroupAutoscalingPolicyConfig

The workerConfig.

getWorkerConfigOrBuilder()

public InstanceGroupAutoscalingPolicyConfigOrBuilder getWorkerConfigOrBuilder()

Required. Describes how the autoscaler will operate for primary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
InstanceGroupAutoscalingPolicyConfigOrBuilder

hasBasicAlgorithm()

public boolean hasBasicAlgorithm()

.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the basicAlgorithm field is set.

hasSecondaryWorkerConfig()

public boolean hasSecondaryWorkerConfig()

Optional. Describes how the autoscaler will operate for secondary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the secondaryWorkerConfig field is set.

hasWorkerConfig()

public boolean hasWorkerConfig()

Required. Describes how the autoscaler will operate for primary workers.

.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the workerConfig field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

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.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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