Enum EmrCreateCluster.SpotAllocationStrategy
java.lang.Object
java.lang.Enum<EmrCreateCluster.SpotAllocationStrategy>
software.amazon.awscdk.services.stepfunctions.tasks.EmrCreateCluster.SpotAllocationStrategy
- All Implemented Interfaces:
Serializable
,Comparable<EmrCreateCluster.SpotAllocationStrategy>
,java.lang.constant.Constable
- Enclosing class:
EmrCreateCluster
@Stability(Stable)
public static enum EmrCreateCluster.SpotAllocationStrategy
extends Enum<EmrCreateCluster.SpotAllocationStrategy>
Spot Allocation Strategies.
Specifies the strategy to use in launching Spot Instance fleets. For example, "capacity-optimized" launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
Example:
EmrCreateCluster.Builder.create(this, "OnDemandSpecification") .instances(InstancesConfigProperty.builder() .instanceFleets(List.of(InstanceFleetConfigProperty.builder() .instanceFleetType(EmrCreateCluster.getInstanceRoleType().MASTER) .launchSpecifications(InstanceFleetProvisioningSpecificationsProperty.builder() .onDemandSpecification(OnDemandProvisioningSpecificationProperty.builder() .allocationStrategy(EmrCreateCluster.getOnDemandAllocationStrategy().LOWEST_PRICE) .build()) .build()) .build())) .build()) .name("OnDemandCluster") .integrationPattern(IntegrationPattern.RUN_JOB) .build(); EmrCreateCluster.Builder.create(this, "SpotSpecification") .instances(InstancesConfigProperty.builder() .instanceFleets(List.of(InstanceFleetConfigProperty.builder() .instanceFleetType(EmrCreateCluster.getInstanceRoleType().MASTER) .launchSpecifications(InstanceFleetProvisioningSpecificationsProperty.builder() .spotSpecification(SpotProvisioningSpecificationProperty.builder() .allocationStrategy(EmrCreateCluster.getSpotAllocationStrategy().CAPACITY_OPTIMIZED) .timeoutAction(EmrCreateCluster.getSpotTimeoutAction().TERMINATE_CLUSTER) .timeout(Duration.minutes(5)) .build()) .build()) .build())) .build()) .name("SpotCluster") .integrationPattern(IntegrationPattern.RUN_JOB) .build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionCapacity-optimized, which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.Diversified, which launches instances across all Spot capacity pools.Lowest-price, which launches instances from the lowest priced pool that has available capacity.Price-capacity-optimized, which launches instances from Spot Instance pools with the highest capacity availability for the number of instances that are launching. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CAPACITY_OPTIMIZED
Capacity-optimized, which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching. -
PRICE_CAPACITY_OPTIMIZED
@Stability(Stable) public static final EmrCreateCluster.SpotAllocationStrategy PRICE_CAPACITY_OPTIMIZEDPrice-capacity-optimized, which launches instances from Spot Instance pools with the highest capacity availability for the number of instances that are launching.Recommended.
-
LOWEST_PRICE
Lowest-price, which launches instances from the lowest priced pool that has available capacity. -
DIVERSIFIED
Diversified, which launches instances across all Spot capacity pools.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-