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

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

Introduction

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

Prototype


public void setInstanceTypeConfigs(java.util.Collection<InstanceTypeConfig> instanceTypeConfigs) 

Source Link

Document

The instance type configurations that define the EC2 instances in the instance fleet.

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   www.j  av a 2s. c  o  m
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;
}