Example usage for com.amazonaws.services.elasticmapreduce.model InstanceGroupConfig InstanceGroupConfig

List of usage examples for com.amazonaws.services.elasticmapreduce.model InstanceGroupConfig InstanceGroupConfig

Introduction

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

Prototype

public InstanceGroupConfig(InstanceRoleType instanceRole, String instanceType, Integer instanceCount) 

Source Link

Document

Constructs a new InstanceGroupConfig object.

Usage

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

License:Apache License

/**
 * Create the instance group configuration.
 *
 * @param roleType role type for the instance group (MASTER/CORE/TASK).
 * @param instanceType EC2 instance type for the instance group.
 * @param instanceCount number of instances for the instance group.
 * @param bidPrice bid price in case of SPOT instance request.
 *
 * @return the instance group config object.
 *//* ww w  .  j  av  a2 s  .c o m*/
private InstanceGroupConfig getInstanceGroupConfig(InstanceRoleType roleType, String instanceType,
        Integer instanceCount, BigDecimal bidPrice) {
    InstanceGroupConfig instanceGroup = new InstanceGroupConfig(roleType, instanceType, instanceCount);

    // Consider spot price, if specified
    if (bidPrice != null) {
        instanceGroup.setMarket(MarketType.SPOT);
        instanceGroup.setBidPrice(bidPrice.toString());
    }
    return instanceGroup;
}

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

License:Apache License

/**
 * Creates an instance group configuration.
 *
 * @param roleType role type for the instance group (MASTER/CORE/TASK)
 * @param instanceType EC2 instance type for the instance group
 * @param instanceCount number of instances for the instance group
 * @param bidPrice bid price in case of SPOT instance request
 * @param emrClusterDefinitionEbsConfiguration the instance of {@link EmrClusterDefinitionEbsConfiguration} that contains EBS configurations that will be
 * attached to each EC2 instance in this instance group
 *
 * @return the instance group config object
 *///from  w  w w. java  2 s.c om
protected InstanceGroupConfig getInstanceGroupConfig(InstanceRoleType roleType, String instanceType,
        Integer instanceCount, BigDecimal bidPrice,
        EmrClusterDefinitionEbsConfiguration emrClusterDefinitionEbsConfiguration) {
    // Create an instance group configuration with an optional EBS configuration.
    InstanceGroupConfig instanceGroup = new InstanceGroupConfig(roleType, instanceType, instanceCount)
            .withEbsConfiguration(getEbsConfiguration(emrClusterDefinitionEbsConfiguration));

    // Consider spot price, if specified.
    if (bidPrice != null) {
        instanceGroup.setMarket(MarketType.SPOT);
        instanceGroup.setBidPrice(bidPrice.toString());
    }

    return instanceGroup;
}