Class AutoscalingPolicy.Builder

  • All Implemented Interfaces:
    AutoscalingPolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    AutoscalingPolicy

    public static final class AutoscalingPolicy.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
    implements AutoscalingPolicyOrBuilder
     Describes an autoscaling policy for Dataproc cluster autoscaler.
     
    Protobuf type google.cloud.dataproc.v1.AutoscalingPolicy
    • Method Detail

      • 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.Builder<AutoscalingPolicy.Builder>
      • internalGetMutableMapField

        protected com.google.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • clear

        public AutoscalingPolicy.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • getDefaultInstanceForType

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

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

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

        public AutoscalingPolicy.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • setField

        public AutoscalingPolicy.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • clearField

        public AutoscalingPolicy.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • clearOneof

        public AutoscalingPolicy.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • setRepeatedField

        public AutoscalingPolicy.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          int index,
                                                          Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • addRepeatedField

        public AutoscalingPolicy.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • mergeFrom

        public AutoscalingPolicy.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AutoscalingPolicy.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • mergeFrom

        public AutoscalingPolicy.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AutoscalingPolicy.Builder>
        Throws:
        IOException
      • 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.
      • setId

        public AutoscalingPolicy.Builder setId​(String value)
         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;
        Parameters:
        value - The id to set.
        Returns:
        This builder for chaining.
      • clearId

        public AutoscalingPolicy.Builder clearId()
         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:
        This builder for chaining.
      • setIdBytes

        public AutoscalingPolicy.Builder setIdBytes​(com.google.protobuf.ByteString value)
         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;
        Parameters:
        value - The bytes for id to set.
        Returns:
        This builder for chaining.
      • 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.
      • setName

        public AutoscalingPolicy.Builder setName​(String value)
         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];
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public AutoscalingPolicy.Builder clearName()
         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:
        This builder for chaining.
      • setNameBytes

        public AutoscalingPolicy.Builder setNameBytes​(com.google.protobuf.ByteString value)
         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];
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • 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.
      • clearBasicAlgorithm

        public AutoscalingPolicy.Builder clearBasicAlgorithm()
        .google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];
      • getBasicAlgorithmBuilder

        public BasicAutoscalingAlgorithm.Builder getBasicAlgorithmBuilder()
        .google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];
      • 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.
      • setWorkerConfig

        public AutoscalingPolicy.Builder setWorkerConfig​(InstanceGroupAutoscalingPolicyConfig value)
         Required. Describes how the autoscaler will operate for primary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];
      • mergeWorkerConfig

        public AutoscalingPolicy.Builder mergeWorkerConfig​(InstanceGroupAutoscalingPolicyConfig value)
         Required. Describes how the autoscaler will operate for primary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];
      • clearWorkerConfig

        public AutoscalingPolicy.Builder clearWorkerConfig()
         Required. Describes how the autoscaler will operate for primary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];
      • getWorkerConfigBuilder

        public InstanceGroupAutoscalingPolicyConfig.Builder getWorkerConfigBuilder()
         Required. Describes how the autoscaler will operate for primary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(.google.api.field_behavior) = REQUIRED];
      • 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.
      • setSecondaryWorkerConfig

        public AutoscalingPolicy.Builder setSecondaryWorkerConfig​(InstanceGroupAutoscalingPolicyConfig value)
         Optional. Describes how the autoscaler will operate for secondary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];
      • setSecondaryWorkerConfig

        public AutoscalingPolicy.Builder setSecondaryWorkerConfig​(InstanceGroupAutoscalingPolicyConfig.Builder builderForValue)
         Optional. Describes how the autoscaler will operate for secondary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];
      • mergeSecondaryWorkerConfig

        public AutoscalingPolicy.Builder mergeSecondaryWorkerConfig​(InstanceGroupAutoscalingPolicyConfig value)
         Optional. Describes how the autoscaler will operate for secondary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];
      • clearSecondaryWorkerConfig

        public AutoscalingPolicy.Builder clearSecondaryWorkerConfig()
         Optional. Describes how the autoscaler will operate for secondary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];
      • getSecondaryWorkerConfigBuilder

        public InstanceGroupAutoscalingPolicyConfig.Builder getSecondaryWorkerConfigBuilder()
         Optional. Describes how the autoscaler will operate for secondary workers.
         
        .google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(.google.api.field_behavior) = OPTIONAL];
      • 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
      • removeLabels

        public AutoscalingPolicy.Builder removeLabels​(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];
      • getMutableLabels

        @Deprecated
        public Map<String,​String> getMutableLabels()
        Deprecated.
        Use alternate mutation accessors instead.
      • putLabels

        public AutoscalingPolicy.Builder putLabels​(String key,
                                                   String value)
         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];
      • putAllLabels

        public AutoscalingPolicy.Builder putAllLabels​(Map<String,​String> values)
         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];
      • setUnknownFields

        public final AutoscalingPolicy.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>
      • mergeUnknownFields

        public final AutoscalingPolicy.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AutoscalingPolicy.Builder>