class EmrDaoImpl implements EmrDao {

    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;
    }

}