com.amazonaws.services.elasticmapreduce.model.SpotProvisioningSpecification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-emr Show documentation
/*
* Copyright 2012-2017 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;
/**
*
* The launch specification for Spot instances in the instance fleet, which determines the defined duration and
* provisioning timeout behavior.
*
*
*
* The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
*
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SpotProvisioningSpecification implements Serializable, Cloneable, StructuredPojo {
/**
*
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period,
* the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only
* during initial provisioning, when the cluster is first created.
*
*/
private Integer timeoutDurationMinutes;
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*/
private String timeoutAction;
/**
*
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance
* does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies.
* Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives
* its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a
* Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
*
*/
private Integer blockDurationMinutes;
/**
*
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period,
* the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only
* during initial provisioning, when the cluster is first created.
*
*
* @param timeoutDurationMinutes
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time
* period, the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout
* applies only during initial provisioning, when the cluster is first created.
*/
public void setTimeoutDurationMinutes(Integer timeoutDurationMinutes) {
this.timeoutDurationMinutes = timeoutDurationMinutes;
}
/**
*
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period,
* the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only
* during initial provisioning, when the cluster is first created.
*
*
* @return The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time
* period, the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The
* timeout applies only during initial provisioning, when the cluster is first created.
*/
public Integer getTimeoutDurationMinutes() {
return this.timeoutDurationMinutes;
}
/**
*
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period,
* the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only
* during initial provisioning, when the cluster is first created.
*
*
* @param timeoutDurationMinutes
* The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time
* period, the TimeOutAction
is taken. Minimum value is 5 and maximum value is 1440. The timeout
* applies only during initial provisioning, when the cluster is first created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SpotProvisioningSpecification withTimeoutDurationMinutes(Integer timeoutDurationMinutes) {
setTimeoutDurationMinutes(timeoutDurationMinutes);
return this;
}
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*
* @param timeoutAction
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and
* SWITCH_TO_ON_DEMAND
. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available,
* On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
* @see SpotProvisioningTimeoutAction
*/
public void setTimeoutAction(String timeoutAction) {
this.timeoutAction = timeoutAction;
}
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*
* @return The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and
* SWITCH_TO_ON_DEMAND
. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available,
* On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
* @see SpotProvisioningTimeoutAction
*/
public String getTimeoutAction() {
return this.timeoutAction;
}
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*
* @param timeoutAction
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and
* SWITCH_TO_ON_DEMAND
. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available,
* On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SpotProvisioningTimeoutAction
*/
public SpotProvisioningSpecification withTimeoutAction(String timeoutAction) {
setTimeoutAction(timeoutAction);
return this;
}
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*
* @param timeoutAction
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and
* SWITCH_TO_ON_DEMAND
. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available,
* On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
* @see SpotProvisioningTimeoutAction
*/
public void setTimeoutAction(SpotProvisioningTimeoutAction timeoutAction) {
withTimeoutAction(timeoutAction);
}
/**
*
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and SWITCH_TO_ON_DEMAND
.
* SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand Instances should be provisioned
* to fulfill any remaining Spot capacity.
*
*
* @param timeoutAction
* The action to take when TargetSpotCapacity
has not been fulfilled when the
* TimeoutDurationMinutes
has expired. Spot instances are not uprovisioned within the Spot
* provisioining timeout. Valid values are TERMINATE_CLUSTER
and
* SWITCH_TO_ON_DEMAND
. SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available,
* On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SpotProvisioningTimeoutAction
*/
public SpotProvisioningSpecification withTimeoutAction(SpotProvisioningTimeoutAction timeoutAction) {
this.timeoutAction = timeoutAction.toString();
return this;
}
/**
*
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance
* does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies.
* Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives
* its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a
* Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
*
*
* @param blockDurationMinutes
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot
* instance does not terminate before the defined duration expires, and defined duration pricing for Spot
* instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as
* a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance
* for termination and provides a Spot instance termination notice, which gives the instance a two-minute
* warning before it terminates.
*/
public void setBlockDurationMinutes(Integer blockDurationMinutes) {
this.blockDurationMinutes = blockDurationMinutes;
}
/**
*
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance
* does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies.
* Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives
* its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a
* Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
*
*
* @return The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot
* instance does not terminate before the defined duration expires, and defined duration pricing for Spot
* instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as
* a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance
* for termination and provides a Spot instance termination notice, which gives the instance a two-minute
* warning before it terminates.
*/
public Integer getBlockDurationMinutes() {
return this.blockDurationMinutes;
}
/**
*
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance
* does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies.
* Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives
* its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a
* Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
*
*
* @param blockDurationMinutes
* The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot
* instance does not terminate before the defined duration expires, and defined duration pricing for Spot
* instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as
* a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance
* for termination and provides a Spot instance termination notice, which gives the instance a two-minute
* warning before it terminates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SpotProvisioningSpecification withBlockDurationMinutes(Integer blockDurationMinutes) {
setBlockDurationMinutes(blockDurationMinutes);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getTimeoutDurationMinutes() != null)
sb.append("TimeoutDurationMinutes: ").append(getTimeoutDurationMinutes()).append(",");
if (getTimeoutAction() != null)
sb.append("TimeoutAction: ").append(getTimeoutAction()).append(",");
if (getBlockDurationMinutes() != null)
sb.append("BlockDurationMinutes: ").append(getBlockDurationMinutes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SpotProvisioningSpecification == false)
return false;
SpotProvisioningSpecification other = (SpotProvisioningSpecification) obj;
if (other.getTimeoutDurationMinutes() == null ^ this.getTimeoutDurationMinutes() == null)
return false;
if (other.getTimeoutDurationMinutes() != null && other.getTimeoutDurationMinutes().equals(this.getTimeoutDurationMinutes()) == false)
return false;
if (other.getTimeoutAction() == null ^ this.getTimeoutAction() == null)
return false;
if (other.getTimeoutAction() != null && other.getTimeoutAction().equals(this.getTimeoutAction()) == false)
return false;
if (other.getBlockDurationMinutes() == null ^ this.getBlockDurationMinutes() == null)
return false;
if (other.getBlockDurationMinutes() != null && other.getBlockDurationMinutes().equals(this.getBlockDurationMinutes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTimeoutDurationMinutes() == null) ? 0 : getTimeoutDurationMinutes().hashCode());
hashCode = prime * hashCode + ((getTimeoutAction() == null) ? 0 : getTimeoutAction().hashCode());
hashCode = prime * hashCode + ((getBlockDurationMinutes() == null) ? 0 : getBlockDurationMinutes().hashCode());
return hashCode;
}
@Override
public SpotProvisioningSpecification clone() {
try {
return (SpotProvisioningSpecification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.elasticmapreduce.model.transform.SpotProvisioningSpecificationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}