/* * 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; /** *
* 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. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AutoScalingPolicyDescription implements Serializable, Cloneable, StructuredPojo { /** ** The status of an automatic scaling policy. *
*/ private AutoScalingPolicyStatus status; /** ** The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity will * not cause an instance group to grow above or below these limits. *
*/ private ScalingConstraints constraints; /** ** The scale-in and scale-out rules that comprise the automatic scaling policy. *
*/ private com.amazonaws.internal.SdkInternalList* The status of an automatic scaling policy. *
* * @param status * The status of an automatic scaling policy. */ public void setStatus(AutoScalingPolicyStatus status) { this.status = status; } /** ** The status of an automatic scaling policy. *
* * @return The status of an automatic scaling policy. */ public AutoScalingPolicyStatus getStatus() { return this.status; } /** ** The status of an automatic scaling policy. *
* * @param status * The status of an automatic scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingPolicyDescription withStatus(AutoScalingPolicyStatus status) { setStatus(status); return this; } /** ** The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity will * not cause an instance group to grow above or below these limits. *
* * @param constraints * The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity * will not cause an instance group to grow above or below these limits. */ public void setConstraints(ScalingConstraints constraints) { this.constraints = constraints; } /** ** The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity will * not cause an instance group to grow above or below these limits. *
* * @return The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling * activity will not cause an instance group to grow above or below these limits. */ public ScalingConstraints getConstraints() { return this.constraints; } /** ** The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity will * not cause an instance group to grow above or below these limits. *
* * @param constraints * The upper and lower Amazon EC2 instance limits for an automatic scaling policy. Automatic scaling activity * will not cause an instance group to grow above or below these limits. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingPolicyDescription withConstraints(ScalingConstraints constraints) { setConstraints(constraints); return this; } /** ** The scale-in and scale-out rules that comprise the automatic scaling policy. *
* * @return The scale-in and scale-out rules that comprise the automatic scaling policy. */ public java.util.List* The scale-in and scale-out rules that comprise the automatic scaling policy. *
* * @param rules * The scale-in and scale-out rules that comprise the automatic scaling policy. */ public void setRules(java.util.Collection* The scale-in and scale-out rules that comprise the automatic scaling policy. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRules(java.util.Collection)} or {@link #withRules(java.util.Collection)} if you want to override the * existing values. *
* * @param rules * The scale-in and scale-out rules that comprise the automatic scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingPolicyDescription withRules(ScalingRule... rules) { if (this.rules == null) { setRules(new com.amazonaws.internal.SdkInternalList* The scale-in and scale-out rules that comprise the automatic scaling policy. *
* * @param rules * The scale-in and scale-out rules that comprise the automatic scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingPolicyDescription withRules(java.util.Collection