All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.emr.model.JobFlowInstancesConfig Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.emr.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* A description of the Amazon EC2 instance on which the cluster (job flow) runs. A valid JobFlowInstancesConfig must * contain either InstanceGroups or InstanceFleets. They cannot be used together. You may also have MasterInstanceType, * SlaveInstanceType, and InstanceCount (all three must be present), but we don't recommend this configuration. *

*/ @Generated("software.amazon.awssdk:codegen") public final class JobFlowInstancesConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MASTER_INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MasterInstanceType").getter(getter(JobFlowInstancesConfig::masterInstanceType)) .setter(setter(Builder::masterInstanceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MasterInstanceType").build()) .build(); private static final SdkField SLAVE_INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SlaveInstanceType").getter(getter(JobFlowInstancesConfig::slaveInstanceType)) .setter(setter(Builder::slaveInstanceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SlaveInstanceType").build()).build(); private static final SdkField INSTANCE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("InstanceCount").getter(getter(JobFlowInstancesConfig::instanceCount)) .setter(setter(Builder::instanceCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceCount").build()).build(); private static final SdkField> INSTANCE_GROUPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("InstanceGroups") .getter(getter(JobFlowInstancesConfig::instanceGroups)) .setter(setter(Builder::instanceGroups)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceGroups").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(InstanceGroupConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> INSTANCE_FLEETS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("InstanceFleets") .getter(getter(JobFlowInstancesConfig::instanceFleets)) .setter(setter(Builder::instanceFleets)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceFleets").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(InstanceFleetConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField EC2_KEY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Ec2KeyName").getter(getter(JobFlowInstancesConfig::ec2KeyName)).setter(setter(Builder::ec2KeyName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ec2KeyName").build()).build(); private static final SdkField PLACEMENT_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Placement").getter(getter(JobFlowInstancesConfig::placement)).setter(setter(Builder::placement)) .constructor(PlacementType::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Placement").build()).build(); private static final SdkField KEEP_JOB_FLOW_ALIVE_WHEN_NO_STEPS_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("KeepJobFlowAliveWhenNoSteps") .getter(getter(JobFlowInstancesConfig::keepJobFlowAliveWhenNoSteps)) .setter(setter(Builder::keepJobFlowAliveWhenNoSteps)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeepJobFlowAliveWhenNoSteps") .build()).build(); private static final SdkField TERMINATION_PROTECTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("TerminationProtected").getter(getter(JobFlowInstancesConfig::terminationProtected)) .setter(setter(Builder::terminationProtected)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TerminationProtected").build()) .build(); private static final SdkField HADOOP_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("HadoopVersion").getter(getter(JobFlowInstancesConfig::hadoopVersion)) .setter(setter(Builder::hadoopVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HadoopVersion").build()).build(); private static final SdkField EC2_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Ec2SubnetId").getter(getter(JobFlowInstancesConfig::ec2SubnetId)).setter(setter(Builder::ec2SubnetId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ec2SubnetId").build()).build(); private static final SdkField> EC2_SUBNET_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Ec2SubnetIds") .getter(getter(JobFlowInstancesConfig::ec2SubnetIds)) .setter(setter(Builder::ec2SubnetIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ec2SubnetIds").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField EMR_MANAGED_MASTER_SECURITY_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("EmrManagedMasterSecurityGroup") .getter(getter(JobFlowInstancesConfig::emrManagedMasterSecurityGroup)) .setter(setter(Builder::emrManagedMasterSecurityGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmrManagedMasterSecurityGroup") .build()).build(); private static final SdkField EMR_MANAGED_SLAVE_SECURITY_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("EmrManagedSlaveSecurityGroup") .getter(getter(JobFlowInstancesConfig::emrManagedSlaveSecurityGroup)) .setter(setter(Builder::emrManagedSlaveSecurityGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmrManagedSlaveSecurityGroup") .build()).build(); private static final SdkField SERVICE_ACCESS_SECURITY_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("ServiceAccessSecurityGroup") .getter(getter(JobFlowInstancesConfig::serviceAccessSecurityGroup)) .setter(setter(Builder::serviceAccessSecurityGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceAccessSecurityGroup").build()) .build(); private static final SdkField> ADDITIONAL_MASTER_SECURITY_GROUPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AdditionalMasterSecurityGroups") .getter(getter(JobFlowInstancesConfig::additionalMasterSecurityGroups)) .setter(setter(Builder::additionalMasterSecurityGroups)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AdditionalMasterSecurityGroups") .build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> ADDITIONAL_SLAVE_SECURITY_GROUPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AdditionalSlaveSecurityGroups") .getter(getter(JobFlowInstancesConfig::additionalSlaveSecurityGroups)) .setter(setter(Builder::additionalSlaveSecurityGroups)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AdditionalSlaveSecurityGroups") .build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MASTER_INSTANCE_TYPE_FIELD, SLAVE_INSTANCE_TYPE_FIELD, INSTANCE_COUNT_FIELD, INSTANCE_GROUPS_FIELD, INSTANCE_FLEETS_FIELD, EC2_KEY_NAME_FIELD, PLACEMENT_FIELD, KEEP_JOB_FLOW_ALIVE_WHEN_NO_STEPS_FIELD, TERMINATION_PROTECTED_FIELD, HADOOP_VERSION_FIELD, EC2_SUBNET_ID_FIELD, EC2_SUBNET_IDS_FIELD, EMR_MANAGED_MASTER_SECURITY_GROUP_FIELD, EMR_MANAGED_SLAVE_SECURITY_GROUP_FIELD, SERVICE_ACCESS_SECURITY_GROUP_FIELD, ADDITIONAL_MASTER_SECURITY_GROUPS_FIELD, ADDITIONAL_SLAVE_SECURITY_GROUPS_FIELD)); private static final long serialVersionUID = 1L; private final String masterInstanceType; private final String slaveInstanceType; private final Integer instanceCount; private final List instanceGroups; private final List instanceFleets; private final String ec2KeyName; private final PlacementType placement; private final Boolean keepJobFlowAliveWhenNoSteps; private final Boolean terminationProtected; private final String hadoopVersion; private final String ec2SubnetId; private final List ec2SubnetIds; private final String emrManagedMasterSecurityGroup; private final String emrManagedSlaveSecurityGroup; private final String serviceAccessSecurityGroup; private final List additionalMasterSecurityGroups; private final List additionalSlaveSecurityGroups; private JobFlowInstancesConfig(BuilderImpl builder) { this.masterInstanceType = builder.masterInstanceType; this.slaveInstanceType = builder.slaveInstanceType; this.instanceCount = builder.instanceCount; this.instanceGroups = builder.instanceGroups; this.instanceFleets = builder.instanceFleets; this.ec2KeyName = builder.ec2KeyName; this.placement = builder.placement; this.keepJobFlowAliveWhenNoSteps = builder.keepJobFlowAliveWhenNoSteps; this.terminationProtected = builder.terminationProtected; this.hadoopVersion = builder.hadoopVersion; this.ec2SubnetId = builder.ec2SubnetId; this.ec2SubnetIds = builder.ec2SubnetIds; this.emrManagedMasterSecurityGroup = builder.emrManagedMasterSecurityGroup; this.emrManagedSlaveSecurityGroup = builder.emrManagedSlaveSecurityGroup; this.serviceAccessSecurityGroup = builder.serviceAccessSecurityGroup; this.additionalMasterSecurityGroups = builder.additionalMasterSecurityGroups; this.additionalSlaveSecurityGroups = builder.additionalSlaveSecurityGroups; } /** *

* The Amazon EC2 instance type of the master node. *

* * @return The Amazon EC2 instance type of the master node. */ public final String masterInstanceType() { return masterInstanceType; } /** *

* The Amazon EC2 instance type of the core and task nodes. *

* * @return The Amazon EC2 instance type of the core and task nodes. */ public final String slaveInstanceType() { return slaveInstanceType; } /** *

* The number of Amazon EC2 instances in the cluster. *

* * @return The number of Amazon EC2 instances in the cluster. */ public final Integer instanceCount() { return instanceCount; } /** * For responses, this returns true if the service returned a value for the InstanceGroups property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasInstanceGroups() { return instanceGroups != null && !(instanceGroups instanceof SdkAutoConstructList); } /** *

* Configuration for the instance groups in a cluster. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInstanceGroups} method. *

* * @return Configuration for the instance groups in a cluster. */ public final List instanceGroups() { return instanceGroups; } /** * For responses, this returns true if the service returned a value for the InstanceFleets property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasInstanceFleets() { return instanceFleets != null && !(instanceFleets instanceof SdkAutoConstructList); } /** * *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

*
*

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance fleet * configuration. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInstanceFleets} method. *

* * @return

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

* *

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance fleet * configuration. */ public final List instanceFleets() { return instanceFleets; } /** *

* The name of the Amazon EC2 key pair that can be used to connect to the master node using SSH as the user called * "hadoop." *

* * @return The name of the Amazon EC2 key pair that can be used to connect to the master node using SSH as the user * called "hadoop." */ public final String ec2KeyName() { return ec2KeyName; } /** *

* The Availability Zone in which the cluster runs. *

* * @return The Availability Zone in which the cluster runs. */ public final PlacementType placement() { return placement; } /** *

* Specifies whether the cluster should remain available after completing all steps. Defaults to true. * For more information about configuring cluster termination, see Control Cluster * Termination in the EMR Management Guide. *

* * @return Specifies whether the cluster should remain available after completing all steps. Defaults to * true. For more information about configuring cluster termination, see Control Cluster * Termination in the EMR Management Guide. */ public final Boolean keepJobFlowAliveWhenNoSteps() { return keepJobFlowAliveWhenNoSteps; } /** *

* Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API call, user * intervention, or in the event of a job-flow error. *

* * @return Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API * call, user intervention, or in the event of a job-flow error. */ public final Boolean terminationProtected() { return terminationProtected; } /** *

* Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid inputs * are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer maintained), "1.0.3", * "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, unless the * AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for * that AMI version is used. *

* * @return Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid * inputs are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer * maintained), "1.0.3", "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, * unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default * version of Hadoop for that AMI version is used. */ public final String hadoopVersion() { return hadoopVersion; } /** *

* Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual * Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the * cluster to launch. If you do not specify this value and your account supports EC2-Classic, the cluster launches * in EC2-Classic. *

* * @return Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon * Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where * you want the cluster to launch. If you do not specify this value and your account supports EC2-Classic, * the cluster launches in EC2-Classic. */ public final String ec2SubnetId() { return ec2SubnetId; } /** * For responses, this returns true if the service returned a value for the Ec2SubnetIds property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasEc2SubnetIds() { return ec2SubnetIds != null && !(ec2SubnetIds instanceof SdkAutoConstructList); } /** *

* Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are specified, * Amazon EMR evaluates them and launches instances in the optimal subnet. *

* *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasEc2SubnetIds} method. *

* * @return Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are * specified, Amazon EMR evaluates them and launches instances in the optimal subnet.

*

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

*/ public final List ec2SubnetIds() { return ec2SubnetIds; } /** *

* The identifier of the Amazon EC2 security group for the master node. If you specify * EmrManagedMasterSecurityGroup, you must also specify EmrManagedSlaveSecurityGroup. *

* * @return The identifier of the Amazon EC2 security group for the master node. If you specify * EmrManagedMasterSecurityGroup, you must also specify * EmrManagedSlaveSecurityGroup. */ public final String emrManagedMasterSecurityGroup() { return emrManagedMasterSecurityGroup; } /** *

* The identifier of the Amazon EC2 security group for the core and task nodes. If you specify * EmrManagedSlaveSecurityGroup, you must also specify EmrManagedMasterSecurityGroup. *

* * @return The identifier of the Amazon EC2 security group for the core and task nodes. If you specify * EmrManagedSlaveSecurityGroup, you must also specify * EmrManagedMasterSecurityGroup. */ public final String emrManagedSlaveSecurityGroup() { return emrManagedSlaveSecurityGroup; } /** *

* The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private * subnets. *

* * @return The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC * private subnets. */ public final String serviceAccessSecurityGroup() { return serviceAccessSecurityGroup; } /** * For responses, this returns true if the service returned a value for the AdditionalMasterSecurityGroups property. * This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasAdditionalMasterSecurityGroups() { return additionalMasterSecurityGroups != null && !(additionalMasterSecurityGroups instanceof SdkAutoConstructList); } /** *

* A list of additional Amazon EC2 security group IDs for the master node. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAdditionalMasterSecurityGroups} method. *

* * @return A list of additional Amazon EC2 security group IDs for the master node. */ public final List additionalMasterSecurityGroups() { return additionalMasterSecurityGroups; } /** * For responses, this returns true if the service returned a value for the AdditionalSlaveSecurityGroups property. * This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasAdditionalSlaveSecurityGroups() { return additionalSlaveSecurityGroups != null && !(additionalSlaveSecurityGroups instanceof SdkAutoConstructList); } /** *

* A list of additional Amazon EC2 security group IDs for the core and task nodes. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAdditionalSlaveSecurityGroups} method. *

* * @return A list of additional Amazon EC2 security group IDs for the core and task nodes. */ public final List additionalSlaveSecurityGroups() { return additionalSlaveSecurityGroups; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(masterInstanceType()); hashCode = 31 * hashCode + Objects.hashCode(slaveInstanceType()); hashCode = 31 * hashCode + Objects.hashCode(instanceCount()); hashCode = 31 * hashCode + Objects.hashCode(hasInstanceGroups() ? instanceGroups() : null); hashCode = 31 * hashCode + Objects.hashCode(hasInstanceFleets() ? instanceFleets() : null); hashCode = 31 * hashCode + Objects.hashCode(ec2KeyName()); hashCode = 31 * hashCode + Objects.hashCode(placement()); hashCode = 31 * hashCode + Objects.hashCode(keepJobFlowAliveWhenNoSteps()); hashCode = 31 * hashCode + Objects.hashCode(terminationProtected()); hashCode = 31 * hashCode + Objects.hashCode(hadoopVersion()); hashCode = 31 * hashCode + Objects.hashCode(ec2SubnetId()); hashCode = 31 * hashCode + Objects.hashCode(hasEc2SubnetIds() ? ec2SubnetIds() : null); hashCode = 31 * hashCode + Objects.hashCode(emrManagedMasterSecurityGroup()); hashCode = 31 * hashCode + Objects.hashCode(emrManagedSlaveSecurityGroup()); hashCode = 31 * hashCode + Objects.hashCode(serviceAccessSecurityGroup()); hashCode = 31 * hashCode + Objects.hashCode(hasAdditionalMasterSecurityGroups() ? additionalMasterSecurityGroups() : null); hashCode = 31 * hashCode + Objects.hashCode(hasAdditionalSlaveSecurityGroups() ? additionalSlaveSecurityGroups() : null); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof JobFlowInstancesConfig)) { return false; } JobFlowInstancesConfig other = (JobFlowInstancesConfig) obj; return Objects.equals(masterInstanceType(), other.masterInstanceType()) && Objects.equals(slaveInstanceType(), other.slaveInstanceType()) && Objects.equals(instanceCount(), other.instanceCount()) && hasInstanceGroups() == other.hasInstanceGroups() && Objects.equals(instanceGroups(), other.instanceGroups()) && hasInstanceFleets() == other.hasInstanceFleets() && Objects.equals(instanceFleets(), other.instanceFleets()) && Objects.equals(ec2KeyName(), other.ec2KeyName()) && Objects.equals(placement(), other.placement()) && Objects.equals(keepJobFlowAliveWhenNoSteps(), other.keepJobFlowAliveWhenNoSteps()) && Objects.equals(terminationProtected(), other.terminationProtected()) && Objects.equals(hadoopVersion(), other.hadoopVersion()) && Objects.equals(ec2SubnetId(), other.ec2SubnetId()) && hasEc2SubnetIds() == other.hasEc2SubnetIds() && Objects.equals(ec2SubnetIds(), other.ec2SubnetIds()) && Objects.equals(emrManagedMasterSecurityGroup(), other.emrManagedMasterSecurityGroup()) && Objects.equals(emrManagedSlaveSecurityGroup(), other.emrManagedSlaveSecurityGroup()) && Objects.equals(serviceAccessSecurityGroup(), other.serviceAccessSecurityGroup()) && hasAdditionalMasterSecurityGroups() == other.hasAdditionalMasterSecurityGroups() && Objects.equals(additionalMasterSecurityGroups(), other.additionalMasterSecurityGroups()) && hasAdditionalSlaveSecurityGroups() == other.hasAdditionalSlaveSecurityGroups() && Objects.equals(additionalSlaveSecurityGroups(), other.additionalSlaveSecurityGroups()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString .builder("JobFlowInstancesConfig") .add("MasterInstanceType", masterInstanceType()) .add("SlaveInstanceType", slaveInstanceType()) .add("InstanceCount", instanceCount()) .add("InstanceGroups", hasInstanceGroups() ? instanceGroups() : null) .add("InstanceFleets", hasInstanceFleets() ? instanceFleets() : null) .add("Ec2KeyName", ec2KeyName()) .add("Placement", placement()) .add("KeepJobFlowAliveWhenNoSteps", keepJobFlowAliveWhenNoSteps()) .add("TerminationProtected", terminationProtected()) .add("HadoopVersion", hadoopVersion()) .add("Ec2SubnetId", ec2SubnetId()) .add("Ec2SubnetIds", hasEc2SubnetIds() ? ec2SubnetIds() : null) .add("EmrManagedMasterSecurityGroup", emrManagedMasterSecurityGroup()) .add("EmrManagedSlaveSecurityGroup", emrManagedSlaveSecurityGroup()) .add("ServiceAccessSecurityGroup", serviceAccessSecurityGroup()) .add("AdditionalMasterSecurityGroups", hasAdditionalMasterSecurityGroups() ? additionalMasterSecurityGroups() : null) .add("AdditionalSlaveSecurityGroups", hasAdditionalSlaveSecurityGroups() ? additionalSlaveSecurityGroups() : null) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MasterInstanceType": return Optional.ofNullable(clazz.cast(masterInstanceType())); case "SlaveInstanceType": return Optional.ofNullable(clazz.cast(slaveInstanceType())); case "InstanceCount": return Optional.ofNullable(clazz.cast(instanceCount())); case "InstanceGroups": return Optional.ofNullable(clazz.cast(instanceGroups())); case "InstanceFleets": return Optional.ofNullable(clazz.cast(instanceFleets())); case "Ec2KeyName": return Optional.ofNullable(clazz.cast(ec2KeyName())); case "Placement": return Optional.ofNullable(clazz.cast(placement())); case "KeepJobFlowAliveWhenNoSteps": return Optional.ofNullable(clazz.cast(keepJobFlowAliveWhenNoSteps())); case "TerminationProtected": return Optional.ofNullable(clazz.cast(terminationProtected())); case "HadoopVersion": return Optional.ofNullable(clazz.cast(hadoopVersion())); case "Ec2SubnetId": return Optional.ofNullable(clazz.cast(ec2SubnetId())); case "Ec2SubnetIds": return Optional.ofNullable(clazz.cast(ec2SubnetIds())); case "EmrManagedMasterSecurityGroup": return Optional.ofNullable(clazz.cast(emrManagedMasterSecurityGroup())); case "EmrManagedSlaveSecurityGroup": return Optional.ofNullable(clazz.cast(emrManagedSlaveSecurityGroup())); case "ServiceAccessSecurityGroup": return Optional.ofNullable(clazz.cast(serviceAccessSecurityGroup())); case "AdditionalMasterSecurityGroups": return Optional.ofNullable(clazz.cast(additionalMasterSecurityGroups())); case "AdditionalSlaveSecurityGroups": return Optional.ofNullable(clazz.cast(additionalSlaveSecurityGroups())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((JobFlowInstancesConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon EC2 instance type of the master node. *

* * @param masterInstanceType * The Amazon EC2 instance type of the master node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder masterInstanceType(String masterInstanceType); /** *

* The Amazon EC2 instance type of the core and task nodes. *

* * @param slaveInstanceType * The Amazon EC2 instance type of the core and task nodes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slaveInstanceType(String slaveInstanceType); /** *

* The number of Amazon EC2 instances in the cluster. *

* * @param instanceCount * The number of Amazon EC2 instances in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceCount(Integer instanceCount); /** *

* Configuration for the instance groups in a cluster. *

* * @param instanceGroups * Configuration for the instance groups in a cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceGroups(Collection instanceGroups); /** *

* Configuration for the instance groups in a cluster. *

* * @param instanceGroups * Configuration for the instance groups in a cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceGroups(InstanceGroupConfig... instanceGroups); /** *

* Configuration for the instance groups in a cluster. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.emr.model.InstanceGroupConfig.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.emr.model.InstanceGroupConfig#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.emr.model.InstanceGroupConfig.Builder#build()} is called immediately * and its result is passed to {@link #instanceGroups(List)}. * * @param instanceGroups * a consumer that will call methods on * {@link software.amazon.awssdk.services.emr.model.InstanceGroupConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instanceGroups(java.util.Collection) */ Builder instanceGroups(Consumer... instanceGroups); /** * *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

*
*

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance fleet * configuration. *

* * @param instanceFleets *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

* *

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance * fleet configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceFleets(Collection instanceFleets); /** * *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

* *

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance fleet * configuration. *

* * @param instanceFleets *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

* *

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance * fleet configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceFleets(InstanceFleetConfig... instanceFleets); /** * *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

* *

* Describes the Amazon EC2 instances and instance configurations for clusters that use the instance fleet * configuration. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.emr.model.InstanceFleetConfig.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.emr.model.InstanceFleetConfig#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.emr.model.InstanceFleetConfig.Builder#build()} is called immediately * and its result is passed to {@link #instanceFleets(List)}. * * @param instanceFleets * a consumer that will call methods on * {@link software.amazon.awssdk.services.emr.model.InstanceFleetConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instanceFleets(java.util.Collection) */ Builder instanceFleets(Consumer... instanceFleets); /** *

* The name of the Amazon EC2 key pair that can be used to connect to the master node using SSH as the user * called "hadoop." *

* * @param ec2KeyName * The name of the Amazon EC2 key pair that can be used to connect to the master node using SSH as the * user called "hadoop." * @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2KeyName(String ec2KeyName); /** *

* The Availability Zone in which the cluster runs. *

* * @param placement * The Availability Zone in which the cluster runs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder placement(PlacementType placement); /** *

* The Availability Zone in which the cluster runs. *

* This is a convenience method that creates an instance of the {@link PlacementType.Builder} avoiding the need * to create one manually via {@link PlacementType#builder()}. * *

* When the {@link Consumer} completes, {@link PlacementType.Builder#build()} is called immediately and its * result is passed to {@link #placement(PlacementType)}. * * @param placement * a consumer that will call methods on {@link PlacementType.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #placement(PlacementType) */ default Builder placement(Consumer placement) { return placement(PlacementType.builder().applyMutation(placement).build()); } /** *

* Specifies whether the cluster should remain available after completing all steps. Defaults to * true. For more information about configuring cluster termination, see Control Cluster * Termination in the EMR Management Guide. *

* * @param keepJobFlowAliveWhenNoSteps * Specifies whether the cluster should remain available after completing all steps. Defaults to * true. For more information about configuring cluster termination, see Control * Cluster Termination in the EMR Management Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder keepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps); /** *

* Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API call, * user intervention, or in the event of a job-flow error. *

* * @param terminationProtected * Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API * call, user intervention, or in the event of a job-flow error. * @return Returns a reference to this object so that method calls can be chained together. */ Builder terminationProtected(Boolean terminationProtected); /** *

* Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid * inputs are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer maintained), * "1.0.3", "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, unless the * AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop * for that AMI version is used. *

* * @param hadoopVersion * Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. * Valid inputs are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer * maintained), "1.0.3", "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, * unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default * version of Hadoop for that AMI version is used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hadoopVersion(String hadoopVersion); /** *

* Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon * Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you * want the cluster to launch. If you do not specify this value and your account supports EC2-Classic, the * cluster launches in EC2-Classic. *

* * @param ec2SubnetId * Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon * Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet * where you want the cluster to launch. If you do not specify this value and your account supports * EC2-Classic, the cluster launches in EC2-Classic. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2SubnetId(String ec2SubnetId); /** *

* Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are * specified, Amazon EMR evaluates them and launches instances in the optimal subnet. *

* *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

*
* * @param ec2SubnetIds * Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are * specified, Amazon EMR evaluates them and launches instances in the optimal subnet.

*

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2SubnetIds(Collection ec2SubnetIds); /** *

* Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are * specified, Amazon EMR evaluates them and launches instances in the optimal subnet. *

* *

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x * versions. *

*
* * @param ec2SubnetIds * Applies to clusters that use the instance fleet configuration. When multiple Amazon EC2 subnet IDs are * specified, Amazon EMR evaluates them and launches instances in the optimal subnet.

*

* The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding * 5.0.x versions. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2SubnetIds(String... ec2SubnetIds); /** *

* The identifier of the Amazon EC2 security group for the master node. If you specify * EmrManagedMasterSecurityGroup, you must also specify EmrManagedSlaveSecurityGroup. *

* * @param emrManagedMasterSecurityGroup * The identifier of the Amazon EC2 security group for the master node. If you specify * EmrManagedMasterSecurityGroup, you must also specify * EmrManagedSlaveSecurityGroup. * @return Returns a reference to this object so that method calls can be chained together. */ Builder emrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup); /** *

* The identifier of the Amazon EC2 security group for the core and task nodes. If you specify * EmrManagedSlaveSecurityGroup, you must also specify EmrManagedMasterSecurityGroup. *

* * @param emrManagedSlaveSecurityGroup * The identifier of the Amazon EC2 security group for the core and task nodes. If you specify * EmrManagedSlaveSecurityGroup, you must also specify * EmrManagedMasterSecurityGroup. * @return Returns a reference to this object so that method calls can be chained together. */ Builder emrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup); /** *

* The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private * subnets. *

* * @param serviceAccessSecurityGroup * The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC * private subnets. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceAccessSecurityGroup(String serviceAccessSecurityGroup); /** *

* A list of additional Amazon EC2 security group IDs for the master node. *

* * @param additionalMasterSecurityGroups * A list of additional Amazon EC2 security group IDs for the master node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalMasterSecurityGroups(Collection additionalMasterSecurityGroups); /** *

* A list of additional Amazon EC2 security group IDs for the master node. *

* * @param additionalMasterSecurityGroups * A list of additional Amazon EC2 security group IDs for the master node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalMasterSecurityGroups(String... additionalMasterSecurityGroups); /** *

* A list of additional Amazon EC2 security group IDs for the core and task nodes. *

* * @param additionalSlaveSecurityGroups * A list of additional Amazon EC2 security group IDs for the core and task nodes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalSlaveSecurityGroups(Collection additionalSlaveSecurityGroups); /** *

* A list of additional Amazon EC2 security group IDs for the core and task nodes. *

* * @param additionalSlaveSecurityGroups * A list of additional Amazon EC2 security group IDs for the core and task nodes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder additionalSlaveSecurityGroups(String... additionalSlaveSecurityGroups); } static final class BuilderImpl implements Builder { private String masterInstanceType; private String slaveInstanceType; private Integer instanceCount; private List instanceGroups = DefaultSdkAutoConstructList.getInstance(); private List instanceFleets = DefaultSdkAutoConstructList.getInstance(); private String ec2KeyName; private PlacementType placement; private Boolean keepJobFlowAliveWhenNoSteps; private Boolean terminationProtected; private String hadoopVersion; private String ec2SubnetId; private List ec2SubnetIds = DefaultSdkAutoConstructList.getInstance(); private String emrManagedMasterSecurityGroup; private String emrManagedSlaveSecurityGroup; private String serviceAccessSecurityGroup; private List additionalMasterSecurityGroups = DefaultSdkAutoConstructList.getInstance(); private List additionalSlaveSecurityGroups = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(JobFlowInstancesConfig model) { masterInstanceType(model.masterInstanceType); slaveInstanceType(model.slaveInstanceType); instanceCount(model.instanceCount); instanceGroups(model.instanceGroups); instanceFleets(model.instanceFleets); ec2KeyName(model.ec2KeyName); placement(model.placement); keepJobFlowAliveWhenNoSteps(model.keepJobFlowAliveWhenNoSteps); terminationProtected(model.terminationProtected); hadoopVersion(model.hadoopVersion); ec2SubnetId(model.ec2SubnetId); ec2SubnetIds(model.ec2SubnetIds); emrManagedMasterSecurityGroup(model.emrManagedMasterSecurityGroup); emrManagedSlaveSecurityGroup(model.emrManagedSlaveSecurityGroup); serviceAccessSecurityGroup(model.serviceAccessSecurityGroup); additionalMasterSecurityGroups(model.additionalMasterSecurityGroups); additionalSlaveSecurityGroups(model.additionalSlaveSecurityGroups); } public final String getMasterInstanceType() { return masterInstanceType; } public final void setMasterInstanceType(String masterInstanceType) { this.masterInstanceType = masterInstanceType; } @Override public final Builder masterInstanceType(String masterInstanceType) { this.masterInstanceType = masterInstanceType; return this; } public final String getSlaveInstanceType() { return slaveInstanceType; } public final void setSlaveInstanceType(String slaveInstanceType) { this.slaveInstanceType = slaveInstanceType; } @Override public final Builder slaveInstanceType(String slaveInstanceType) { this.slaveInstanceType = slaveInstanceType; return this; } public final Integer getInstanceCount() { return instanceCount; } public final void setInstanceCount(Integer instanceCount) { this.instanceCount = instanceCount; } @Override public final Builder instanceCount(Integer instanceCount) { this.instanceCount = instanceCount; return this; } public final List getInstanceGroups() { List result = InstanceGroupConfigListCopier.copyToBuilder(this.instanceGroups); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInstanceGroups(Collection instanceGroups) { this.instanceGroups = InstanceGroupConfigListCopier.copyFromBuilder(instanceGroups); } @Override public final Builder instanceGroups(Collection instanceGroups) { this.instanceGroups = InstanceGroupConfigListCopier.copy(instanceGroups); return this; } @Override @SafeVarargs public final Builder instanceGroups(InstanceGroupConfig... instanceGroups) { instanceGroups(Arrays.asList(instanceGroups)); return this; } @Override @SafeVarargs public final Builder instanceGroups(Consumer... instanceGroups) { instanceGroups(Stream.of(instanceGroups).map(c -> InstanceGroupConfig.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getInstanceFleets() { List result = InstanceFleetConfigListCopier.copyToBuilder(this.instanceFleets); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInstanceFleets(Collection instanceFleets) { this.instanceFleets = InstanceFleetConfigListCopier.copyFromBuilder(instanceFleets); } @Override public final Builder instanceFleets(Collection instanceFleets) { this.instanceFleets = InstanceFleetConfigListCopier.copy(instanceFleets); return this; } @Override @SafeVarargs public final Builder instanceFleets(InstanceFleetConfig... instanceFleets) { instanceFleets(Arrays.asList(instanceFleets)); return this; } @Override @SafeVarargs public final Builder instanceFleets(Consumer... instanceFleets) { instanceFleets(Stream.of(instanceFleets).map(c -> InstanceFleetConfig.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getEc2KeyName() { return ec2KeyName; } public final void setEc2KeyName(String ec2KeyName) { this.ec2KeyName = ec2KeyName; } @Override public final Builder ec2KeyName(String ec2KeyName) { this.ec2KeyName = ec2KeyName; return this; } public final PlacementType.Builder getPlacement() { return placement != null ? placement.toBuilder() : null; } public final void setPlacement(PlacementType.BuilderImpl placement) { this.placement = placement != null ? placement.build() : null; } @Override public final Builder placement(PlacementType placement) { this.placement = placement; return this; } public final Boolean getKeepJobFlowAliveWhenNoSteps() { return keepJobFlowAliveWhenNoSteps; } public final void setKeepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps) { this.keepJobFlowAliveWhenNoSteps = keepJobFlowAliveWhenNoSteps; } @Override public final Builder keepJobFlowAliveWhenNoSteps(Boolean keepJobFlowAliveWhenNoSteps) { this.keepJobFlowAliveWhenNoSteps = keepJobFlowAliveWhenNoSteps; return this; } public final Boolean getTerminationProtected() { return terminationProtected; } public final void setTerminationProtected(Boolean terminationProtected) { this.terminationProtected = terminationProtected; } @Override public final Builder terminationProtected(Boolean terminationProtected) { this.terminationProtected = terminationProtected; return this; } public final String getHadoopVersion() { return hadoopVersion; } public final void setHadoopVersion(String hadoopVersion) { this.hadoopVersion = hadoopVersion; } @Override public final Builder hadoopVersion(String hadoopVersion) { this.hadoopVersion = hadoopVersion; return this; } public final String getEc2SubnetId() { return ec2SubnetId; } public final void setEc2SubnetId(String ec2SubnetId) { this.ec2SubnetId = ec2SubnetId; } @Override public final Builder ec2SubnetId(String ec2SubnetId) { this.ec2SubnetId = ec2SubnetId; return this; } public final Collection getEc2SubnetIds() { if (ec2SubnetIds instanceof SdkAutoConstructList) { return null; } return ec2SubnetIds; } public final void setEc2SubnetIds(Collection ec2SubnetIds) { this.ec2SubnetIds = XmlStringMaxLen256ListCopier.copy(ec2SubnetIds); } @Override public final Builder ec2SubnetIds(Collection ec2SubnetIds) { this.ec2SubnetIds = XmlStringMaxLen256ListCopier.copy(ec2SubnetIds); return this; } @Override @SafeVarargs public final Builder ec2SubnetIds(String... ec2SubnetIds) { ec2SubnetIds(Arrays.asList(ec2SubnetIds)); return this; } public final String getEmrManagedMasterSecurityGroup() { return emrManagedMasterSecurityGroup; } public final void setEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; } @Override public final Builder emrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; return this; } public final String getEmrManagedSlaveSecurityGroup() { return emrManagedSlaveSecurityGroup; } public final void setEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; } @Override public final Builder emrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; return this; } public final String getServiceAccessSecurityGroup() { return serviceAccessSecurityGroup; } public final void setServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; } @Override public final Builder serviceAccessSecurityGroup(String serviceAccessSecurityGroup) { this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; return this; } public final Collection getAdditionalMasterSecurityGroups() { if (additionalMasterSecurityGroups instanceof SdkAutoConstructList) { return null; } return additionalMasterSecurityGroups; } public final void setAdditionalMasterSecurityGroups(Collection additionalMasterSecurityGroups) { this.additionalMasterSecurityGroups = SecurityGroupsListCopier.copy(additionalMasterSecurityGroups); } @Override public final Builder additionalMasterSecurityGroups(Collection additionalMasterSecurityGroups) { this.additionalMasterSecurityGroups = SecurityGroupsListCopier.copy(additionalMasterSecurityGroups); return this; } @Override @SafeVarargs public final Builder additionalMasterSecurityGroups(String... additionalMasterSecurityGroups) { additionalMasterSecurityGroups(Arrays.asList(additionalMasterSecurityGroups)); return this; } public final Collection getAdditionalSlaveSecurityGroups() { if (additionalSlaveSecurityGroups instanceof SdkAutoConstructList) { return null; } return additionalSlaveSecurityGroups; } public final void setAdditionalSlaveSecurityGroups(Collection additionalSlaveSecurityGroups) { this.additionalSlaveSecurityGroups = SecurityGroupsListCopier.copy(additionalSlaveSecurityGroups); } @Override public final Builder additionalSlaveSecurityGroups(Collection additionalSlaveSecurityGroups) { this.additionalSlaveSecurityGroups = SecurityGroupsListCopier.copy(additionalSlaveSecurityGroups); return this; } @Override @SafeVarargs public final Builder additionalSlaveSecurityGroups(String... additionalSlaveSecurityGroups) { additionalSlaveSecurityGroups(Arrays.asList(additionalSlaveSecurityGroups)); return this; } @Override public JobFlowInstancesConfig build() { return new JobFlowInstancesConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy