Example usage for com.amazonaws.services.elasticmapreduce.model InstanceFleet getTargetOnDemandCapacity

List of usage examples for com.amazonaws.services.elasticmapreduce.model InstanceFleet getTargetOnDemandCapacity

Introduction

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

Prototype


public Integer getTargetOnDemandCapacity() 

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.helper.EmrHelper.java

License:Apache License

/**
 * Returns  EmrClusterInstanceFleet list from AWS call
 *
 * @param awsInstanceFleetsResult AWS Instance Fleets result
 *
 * @return list of  EmrClusterInstanceFleet
 *///from  w  w  w  . j a v  a2 s . c o  m
public List<EmrClusterInstanceFleet> buildEmrClusterInstanceFleetFromAwsResult(
        ListInstanceFleetsResult awsInstanceFleetsResult) {
    List<EmrClusterInstanceFleet> emrInstanceFleets = null;

    if (awsInstanceFleetsResult != null
            && !CollectionUtils.isEmpty(awsInstanceFleetsResult.getInstanceFleets())) {
        emrInstanceFleets = new ArrayList<>();

        for (InstanceFleet awsInstanceFleet : awsInstanceFleetsResult.getInstanceFleets()) {
            if (awsInstanceFleet != null) {
                EmrClusterInstanceFleet emrInstanceFleet = new EmrClusterInstanceFleet();
                emrInstanceFleet.setId(awsInstanceFleet.getId());
                emrInstanceFleet.setName(awsInstanceFleet.getName());
                emrInstanceFleet.setInstanceFleetType(awsInstanceFleet.getInstanceFleetType());
                emrInstanceFleet.setTargetOnDemandCapacity(awsInstanceFleet.getTargetOnDemandCapacity());
                emrInstanceFleet.setTargetSpotCapacity(awsInstanceFleet.getTargetSpotCapacity());
                emrInstanceFleet
                        .setProvisionedOnDemandCapacity(awsInstanceFleet.getProvisionedOnDemandCapacity());
                emrInstanceFleet.setProvisionedSpotCapacity(awsInstanceFleet.getProvisionedSpotCapacity());
                emrInstanceFleet.setInstanceTypeSpecifications(
                        getInstanceTypeSpecifications(awsInstanceFleet.getInstanceTypeSpecifications()));
                emrInstanceFleet.setLaunchSpecifications(
                        getLaunchSpecifications(awsInstanceFleet.getLaunchSpecifications()));
                emrInstanceFleet
                        .setInstanceFleetStatus(getEmrClusterInstanceFleetStatus(awsInstanceFleet.getStatus()));
                emrInstanceFleets.add(emrInstanceFleet);
            }
        }
    }

    return emrInstanceFleets;
}