/* * Copyright 2018-2023 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 com.amazonaws.services.elasticmapreduce.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Configuration defining a new instance group. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InstanceGroupConfig implements Serializable, Cloneable, StructuredPojo { /** ** Friendly name given to the instance group. *
*/ private String name; /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
*/ private String market; /** ** The role of the instance group in the cluster. *
*/ private String instanceRole; /** *
* If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to
* pay for Spot Instances. Specify OnDemandPrice
to set the amount equal to the On-Demand price, or
* specify an amount in USD.
*
* The Amazon EC2 instance type for all instances in the instance group. *
*/ private String instanceType; /** ** Target number of instances for the instance group. *
*/ private Integer instanceCount; /** ** Amazon EMR releases 4.x or later. *
** The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate * configuration for each instance group (master, core, and task). *
*/ private com.amazonaws.internal.SdkInternalList* EBS configurations that will be attached to each Amazon EC2 instance in the instance group. *
*/ private EbsConfiguration ebsConfiguration; /** ** An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The * automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in * response to the value of a CloudWatch metric. See PutAutoScalingPolicy. *
*/ private AutoScalingPolicy autoScalingPolicy; /** ** The custom AMI ID to use for the provisioned instance group. *
*/ private String customAmiId; /** * Default constructor for InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) * methods to initialize the object after creating it. */ public InstanceGroupConfig() { } /** * Constructs a new InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param instanceRole * The role of the instance group in the cluster. * @param instanceType * The Amazon EC2 instance type for all instances in the instance group. * @param instanceCount * Target number of instances for the instance group. */ public InstanceGroupConfig(String instanceRole, String instanceType, Integer instanceCount) { setInstanceRole(instanceRole); setInstanceType(instanceType); setInstanceCount(instanceCount); } /** * Constructs a new InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param instanceRole * The role of the instance group in the cluster. * @param instanceType * The Amazon EC2 instance type for all instances in the instance group. * @param instanceCount * Target number of instances for the instance group. */ public InstanceGroupConfig(InstanceRoleType instanceRole, String instanceType, Integer instanceCount) { setInstanceRole(instanceRole.toString()); setInstanceType(instanceType); setInstanceCount(instanceCount); } /** ** Friendly name given to the instance group. *
* * @param name * Friendly name given to the instance group. */ public void setName(String name) { this.name = name; } /** ** Friendly name given to the instance group. *
* * @return Friendly name given to the instance group. */ public String getName() { return this.name; } /** ** Friendly name given to the instance group. *
* * @param name * Friendly name given to the instance group. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceGroupConfig withName(String name) { setName(name); return this; } /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
* * @param market * Market type of the Amazon EC2 instances used to create a cluster node. * @see MarketType */ public void setMarket(String market) { this.market = market; } /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
* * @return Market type of the Amazon EC2 instances used to create a cluster node. * @see MarketType */ public String getMarket() { return this.market; } /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
* * @param market * Market type of the Amazon EC2 instances used to create a cluster node. * @return Returns a reference to this object so that method calls can be chained together. * @see MarketType */ public InstanceGroupConfig withMarket(String market) { setMarket(market); return this; } /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
* * @param market * Market type of the Amazon EC2 instances used to create a cluster node. * @see MarketType */ public void setMarket(MarketType market) { withMarket(market); } /** ** Market type of the Amazon EC2 instances used to create a cluster node. *
* * @param market * Market type of the Amazon EC2 instances used to create a cluster node. * @return Returns a reference to this object so that method calls can be chained together. * @see MarketType */ public InstanceGroupConfig withMarket(MarketType market) { this.market = market.toString(); return this; } /** ** The role of the instance group in the cluster. *
* * @param instanceRole * The role of the instance group in the cluster. * @see InstanceRoleType */ public void setInstanceRole(String instanceRole) { this.instanceRole = instanceRole; } /** ** The role of the instance group in the cluster. *
* * @return The role of the instance group in the cluster. * @see InstanceRoleType */ public String getInstanceRole() { return this.instanceRole; } /** ** The role of the instance group in the cluster. *
* * @param instanceRole * The role of the instance group in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceRoleType */ public InstanceGroupConfig withInstanceRole(String instanceRole) { setInstanceRole(instanceRole); return this; } /** ** The role of the instance group in the cluster. *
* * @param instanceRole * The role of the instance group in the cluster. * @see InstanceRoleType */ public void setInstanceRole(InstanceRoleType instanceRole) { withInstanceRole(instanceRole); } /** ** The role of the instance group in the cluster. *
* * @param instanceRole * The role of the instance group in the cluster. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceRoleType */ public InstanceGroupConfig withInstanceRole(InstanceRoleType instanceRole) { this.instanceRole = instanceRole.toString(); return this; } /** *
* If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to
* pay for Spot Instances. Specify OnDemandPrice
to set the amount equal to the On-Demand price, or
* specify an amount in USD.
*
OnDemandPrice
to set the amount equal to the
* On-Demand price, or specify an amount in USD.
*/
public void setBidPrice(String bidPrice) {
this.bidPrice = bidPrice;
}
/**
*
* If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to
* pay for Spot Instances. Specify OnDemandPrice
to set the amount equal to the On-Demand price, or
* specify an amount in USD.
*
OnDemandPrice
to set the amount equal to the
* On-Demand price, or specify an amount in USD.
*/
public String getBidPrice() {
return this.bidPrice;
}
/**
*
* If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to
* pay for Spot Instances. Specify OnDemandPrice
to set the amount equal to the On-Demand price, or
* specify an amount in USD.
*
OnDemandPrice
to set the amount equal to the
* On-Demand price, or specify an amount in USD.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceGroupConfig withBidPrice(String bidPrice) {
setBidPrice(bidPrice);
return this;
}
/**
* * The Amazon EC2 instance type for all instances in the instance group. *
* * @param instanceType * The Amazon EC2 instance type for all instances in the instance group. */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** ** The Amazon EC2 instance type for all instances in the instance group. *
* * @return The Amazon EC2 instance type for all instances in the instance group. */ public String getInstanceType() { return this.instanceType; } /** ** The Amazon EC2 instance type for all instances in the instance group. *
* * @param instanceType * The Amazon EC2 instance type for all instances in the instance group. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceGroupConfig withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** ** Target number of instances for the instance group. *
* * @param instanceCount * Target number of instances for the instance group. */ public void setInstanceCount(Integer instanceCount) { this.instanceCount = instanceCount; } /** ** Target number of instances for the instance group. *
* * @return Target number of instances for the instance group. */ public Integer getInstanceCount() { return this.instanceCount; } /** ** Target number of instances for the instance group. *
* * @param instanceCount * Target number of instances for the instance group. * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceGroupConfig withInstanceCount(Integer instanceCount) { setInstanceCount(instanceCount); return this; } /** ** Amazon EMR releases 4.x or later. *
** The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate * configuration for each instance group (master, core, and task). *
* * @return* Amazon EMR releases 4.x or later. *
* *
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
*/
public java.util.List
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
*
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
*/
public void setConfigurations(java.util.Collection
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConfigurations(java.util.Collection)} or {@link #withConfigurations(java.util.Collection)} if you want
* to override the existing values.
*
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceGroupConfig withConfigurations(Configuration... configurations) {
if (this.configurations == null) {
setConfigurations(new com.amazonaws.internal.SdkInternalList
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
*
* Amazon EMR releases 4.x or later.
*
* The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate
* configuration for each instance group (master, core, and task).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceGroupConfig withConfigurations(java.util.Collection
* EBS configurations that will be attached to each Amazon EC2 instance in the instance group.
*
* EBS configurations that will be attached to each Amazon EC2 instance in the instance group.
*
* EBS configurations that will be attached to each Amazon EC2 instance in the instance group.
*
* An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The
* automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in
* response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
*
* An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The
* automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in
* response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
*
* An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The
* automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in
* response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
*
* The custom AMI ID to use for the provisioned instance group.
*
* The custom AMI ID to use for the provisioned instance group.
*
* The custom AMI ID to use for the provisioned instance group.
*