Class AutoscalingPolicy

  • All Implemented Interfaces:
    AutoscalingPolicyOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class AutoscalingPolicy
    extends com.google.protobuf.GeneratedMessageV3
    implements AutoscalingPolicyOrBuilder
     Describes an autoscaling policy for Dataproc cluster autoscaler.
     
    Protobuf type google.cloud.dataproc.v1.AutoscalingPolicy
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getId in interface AutoscalingPolicyOrBuilder
        Returns:
        The id.
      • getIdBytes

        public com.google.protobuf.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;
        Specified by:
        getIdBytes in interface AutoscalingPolicyOrBuilder
        Returns:
        The bytes for id.
      • 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];
        Specified by:
        getName in interface AutoscalingPolicyOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.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];
        Specified by:
        getNameBytes in interface AutoscalingPolicyOrBuilder
        Returns:
        The bytes for name.
      • hasBasicAlgorithm

        public boolean hasBasicAlgorithm()
        .google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        hasBasicAlgorithm in interface AutoscalingPolicyOrBuilder
        Returns:
        Whether the basicAlgorithm 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];
        Specified by:
        hasWorkerConfig in interface AutoscalingPolicyOrBuilder
        Returns:
        Whether the workerConfig 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];
        Specified by:
        hasSecondaryWorkerConfig in interface AutoscalingPolicyOrBuilder
        Returns:
        Whether the secondaryWorkerConfig field is set.
      • getLabelsCount

        public int getLabelsCount()
        Description copied from interface: AutoscalingPolicyOrBuilder
         Optional. The labels to associate with this autoscaling policy.
         Label **keys** must contain 1 to 63 characters, and must conform to
         [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
         Label **values** may be empty, but, if present, must contain 1 to 63
         characters, and must conform to [RFC
         1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
         associated with an autoscaling policy.
         
        map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLabelsCount in interface AutoscalingPolicyOrBuilder
      • containsLabels

        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](https://www.ietf.org/rfc/rfc1035.txt).
         Label **values** may be empty, but, if present, must contain 1 to 63
         characters, and must conform to [RFC
         1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
         associated with an autoscaling policy.
         
        map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        containsLabels in interface AutoscalingPolicyOrBuilder
      • 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](https://www.ietf.org/rfc/rfc1035.txt).
         Label **values** may be empty, but, if present, must contain 1 to 63
         characters, and must conform to [RFC
         1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
         associated with an autoscaling policy.
         
        map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLabelsMap in interface AutoscalingPolicyOrBuilder
      • getLabelsOrDefault

        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](https://www.ietf.org/rfc/rfc1035.txt).
         Label **values** may be empty, but, if present, must contain 1 to 63
         characters, and must conform to [RFC
         1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
         associated with an autoscaling policy.
         
        map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLabelsOrDefault in interface AutoscalingPolicyOrBuilder
      • getLabelsOrThrow

        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](https://www.ietf.org/rfc/rfc1035.txt).
         Label **values** may be empty, but, if present, must contain 1 to 63
         characters, and must conform to [RFC
         1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
         associated with an autoscaling policy.
         
        map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLabelsOrThrow in interface AutoscalingPolicyOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static AutoscalingPolicy parseFrom​(ByteBuffer data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(ByteBuffer data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(com.google.protobuf.ByteString data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(com.google.protobuf.ByteString data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(byte[] data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(byte[] data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AutoscalingPolicy parseFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Throws:
        IOException
      • newBuilderForType

        public AutoscalingPolicy.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public AutoscalingPolicy.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected AutoscalingPolicy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<AutoscalingPolicy> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public AutoscalingPolicy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder