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:
  • Enum Constant Details

    • CAPACITY_OPTIMIZED

      @Stability(Stable) public static final EmrCreateCluster.SpotAllocationStrategy 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_OPTIMIZED
      Price-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

      @Stability(Stable) public static final EmrCreateCluster.SpotAllocationStrategy LOWEST_PRICE
      Lowest-price, which launches instances from the lowest priced pool that has available capacity.
    • DIVERSIFIED

      @Stability(Stable) public static final EmrCreateCluster.SpotAllocationStrategy DIVERSIFIED
      Diversified, which launches instances across all Spot capacity pools.
  • Method Details

    • values

      public static EmrCreateCluster.SpotAllocationStrategy[] 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

      public static EmrCreateCluster.SpotAllocationStrategy valueOf(String name)
      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 name
      NullPointerException - if the argument is null