use of com.amazonaws.services.elasticmapreduce.model.InstanceTypeConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceTypeConfigs.
@Test
public void testGetInstanceTypeConfigs() {
// Create objects required for testing.
final String instanceType = STRING_VALUE;
final Integer weightedCapacity = INTEGER_VALUE;
final String bidPrice = STRING_VALUE_2;
final Double bidPriceAsPercentageOfOnDemandPrice = DOUBLE_VALUE;
final EmrClusterDefinitionEbsConfiguration emrClusterDefinitionEbsConfiguration = null;
final List<EmrClusterDefinitionConfiguration> emrClusterDefinitionConfigurations = null;
final EmrClusterDefinitionInstanceTypeConfig emrClusterDefinitionInstanceTypeConfig = new EmrClusterDefinitionInstanceTypeConfig(instanceType, weightedCapacity, bidPrice, bidPriceAsPercentageOfOnDemandPrice, emrClusterDefinitionEbsConfiguration, emrClusterDefinitionConfigurations);
// Call the method under test.
List<InstanceTypeConfig> result = emrDaoImpl.getInstanceTypeConfigs(Arrays.asList(emrClusterDefinitionInstanceTypeConfig));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
final List<Configuration> expectedConfigurations = null;
assertEquals(Arrays.asList(new InstanceTypeConfig().withInstanceType(instanceType).withWeightedCapacity(weightedCapacity).withBidPrice(bidPrice).withBidPriceAsPercentageOfOnDemandPrice(bidPriceAsPercentageOfOnDemandPrice).withEbsConfiguration(null).withConfigurations(expectedConfigurations)), result);
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceTypeConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceFleets.
@Test
public void testGetInstanceFleets() {
// Create objects required for testing.
final String name = STRING_VALUE;
final String instanceFleetType = STRING_VALUE_2;
final Integer targetOnDemandCapacity = INTEGER_VALUE;
final Integer targetSpotCapacity = INTEGER_VALUE_2;
final List<EmrClusterDefinitionInstanceTypeConfig> emrClusterDefinitionInstanceTypeConfigs = null;
final EmrClusterDefinitionLaunchSpecifications emrClusterDefinitionLaunchSpecifications = null;
final EmrClusterDefinitionInstanceFleet emrClusterDefinitionInstanceFleet = new EmrClusterDefinitionInstanceFleet(name, instanceFleetType, targetOnDemandCapacity, targetSpotCapacity, emrClusterDefinitionInstanceTypeConfigs, emrClusterDefinitionLaunchSpecifications);
// Call the method under test.
List<InstanceFleetConfig> result = emrDaoImpl.getInstanceFleets(Arrays.asList(emrClusterDefinitionInstanceFleet));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
final List<InstanceTypeConfig> expectedInstanceTypeConfigs = null;
assertEquals(Arrays.asList(new InstanceFleetConfig().withName(name).withInstanceFleetType(instanceFleetType).withTargetOnDemandCapacity(targetOnDemandCapacity).withTargetSpotCapacity(targetSpotCapacity).withInstanceTypeConfigs(expectedInstanceTypeConfigs).withLaunchSpecifications(null)), result);
}
use of com.amazonaws.services.elasticmapreduce.model.InstanceTypeConfig in project herd by FINRAOS.
the class EmrDaoImpl method getInstanceTypeConfigs.
/**
* Creates a list of {@link InstanceTypeConfig} from a given list of {@link EmrClusterDefinitionInstanceTypeConfig}.
*
* @param emrClusterDefinitionInstanceTypeConfigs the list of {@link EmrClusterDefinitionInstanceTypeConfig}
*
* @return the list of {@link InstanceTypeConfig}
*/
protected List<InstanceTypeConfig> getInstanceTypeConfigs(List<EmrClusterDefinitionInstanceTypeConfig> emrClusterDefinitionInstanceTypeConfigs) {
List<InstanceTypeConfig> instanceTypeConfigs = null;
if (!CollectionUtils.isEmpty(emrClusterDefinitionInstanceTypeConfigs)) {
instanceTypeConfigs = new ArrayList<>();
for (EmrClusterDefinitionInstanceTypeConfig emrClusterDefinitionInstanceTypeConfig : emrClusterDefinitionInstanceTypeConfigs) {
if (emrClusterDefinitionInstanceTypeConfig != null) {
InstanceTypeConfig instanceTypeConfig = new InstanceTypeConfig();
instanceTypeConfig.setInstanceType(emrClusterDefinitionInstanceTypeConfig.getInstanceType());
instanceTypeConfig.setWeightedCapacity(emrClusterDefinitionInstanceTypeConfig.getWeightedCapacity());
instanceTypeConfig.setBidPrice(emrClusterDefinitionInstanceTypeConfig.getBidPrice());
instanceTypeConfig.setBidPriceAsPercentageOfOnDemandPrice(emrClusterDefinitionInstanceTypeConfig.getBidPriceAsPercentageOfOnDemandPrice());
instanceTypeConfig.setEbsConfiguration(getEbsConfiguration(emrClusterDefinitionInstanceTypeConfig.getEbsConfiguration()));
instanceTypeConfig.setConfigurations(getConfigurations(emrClusterDefinitionInstanceTypeConfig.getConfigurations()));
instanceTypeConfigs.add(instanceTypeConfig);
}
}
}
return instanceTypeConfigs;
}
Aggregations