Example usage for com.amazonaws.services.elasticmapreduce.model InstanceFleetConfig setTargetOnDemandCapacity

List of usage examples for com.amazonaws.services.elasticmapreduce.model InstanceFleetConfig setTargetOnDemandCapacity

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticmapreduce.model InstanceFleetConfig setTargetOnDemandCapacity.

Prototype


public void setTargetOnDemandCapacity(Integer targetOnDemandCapacity) 

Source Link

Document

The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision.

Usage

From source file:org.finra.herd.dao.impl.EmrDaoImpl.java

License:Apache License

/**
 * Creates an instance fleet configuration that describes the EC2 instances and instance configurations for clusters that use this feature.
 *
 * @param emrClusterDefinitionInstanceFleets the list of instance fleet configurations from the EMR cluster definition
 *
 * @return the instance fleet configuration
 *//*from w  w w. j a  v a2s.  c om*/
protected List<InstanceFleetConfig> getInstanceFleets(
        List<EmrClusterDefinitionInstanceFleet> emrClusterDefinitionInstanceFleets) {
    List<InstanceFleetConfig> instanceFleets = null;

    if (!CollectionUtils.isEmpty(emrClusterDefinitionInstanceFleets)) {
        instanceFleets = new ArrayList<>();

        for (EmrClusterDefinitionInstanceFleet emrClusterDefinitionInstanceFleet : emrClusterDefinitionInstanceFleets) {
            if (emrClusterDefinitionInstanceFleet != null) {
                InstanceFleetConfig instanceFleetConfig = new InstanceFleetConfig();
                instanceFleetConfig.setName(emrClusterDefinitionInstanceFleet.getName());
                instanceFleetConfig
                        .setInstanceFleetType(emrClusterDefinitionInstanceFleet.getInstanceFleetType());
                instanceFleetConfig.setTargetOnDemandCapacity(
                        emrClusterDefinitionInstanceFleet.getTargetOnDemandCapacity());
                instanceFleetConfig
                        .setTargetSpotCapacity(emrClusterDefinitionInstanceFleet.getTargetSpotCapacity());
                instanceFleetConfig.setInstanceTypeConfigs(
                        getInstanceTypeConfigs(emrClusterDefinitionInstanceFleet.getInstanceTypeConfigs()));
                instanceFleetConfig.setLaunchSpecifications(
                        getLaunchSpecifications(emrClusterDefinitionInstanceFleet.getLaunchSpecifications()));

                instanceFleets.add(instanceFleetConfig);
            }
        }
    }

    return instanceFleets;
}