use of com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetInstanceGroupConfig.
@Test
public void testGetInstanceGroupConfig() throws Exception {
// Call the method under test.
InstanceGroupConfig result = emrDaoImpl.getInstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT, BID_PRICE, new EmrClusterDefinitionEbsConfiguration(Collections.singletonList(new EmrClusterDefinitionEbsBlockDeviceConfig(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB), VOLUMES_PER_INSTANCE)), EBS_OPTIMIZED));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(new InstanceGroupConfig(InstanceRoleType.MASTER, EC2_INSTANCE_TYPE, INSTANCE_COUNT).withMarket(MarketType.SPOT).withBidPrice(BID_PRICE.toPlainString()).withEbsConfiguration(new EbsConfiguration().withEbsBlockDeviceConfigs(new EbsBlockDeviceConfig().withVolumeSpecification(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB)).withVolumesPerInstance(VOLUMES_PER_INSTANCE)).withEbsOptimized(EBS_OPTIMIZED)), result);
}
use of com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetEbsConfiguration.
@Test
public void testGetEbsConfiguration() {
// Call the method under test.
EbsConfiguration result = emrDaoImpl.getEbsConfiguration(new EmrClusterDefinitionEbsConfiguration(Collections.singletonList(new EmrClusterDefinitionEbsBlockDeviceConfig(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB), VOLUMES_PER_INSTANCE)), EBS_OPTIMIZED));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(new EbsConfiguration().withEbsBlockDeviceConfigs(new EbsBlockDeviceConfig().withVolumeSpecification(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB)).withVolumesPerInstance(VOLUMES_PER_INSTANCE)).withEbsOptimized(EBS_OPTIMIZED), result);
}
use of com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig in project herd by FINRAOS.
the class EmrDaoImplTest method testGetEbsBlockDeviceConfigs.
@Test
public void testGetEbsBlockDeviceConfigs() {
// Call the method under test.
List<EbsBlockDeviceConfig> result = emrDaoImpl.getEbsBlockDeviceConfigs(Collections.singletonList(new EmrClusterDefinitionEbsBlockDeviceConfig(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB), VOLUMES_PER_INSTANCE)));
// Verify the external calls.
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(Collections.singletonList(new EbsBlockDeviceConfig().withVolumeSpecification(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB)).withVolumesPerInstance(VOLUMES_PER_INSTANCE)), result);
}
use of com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig in project herd by FINRAOS.
the class EmrDaoImpl method getEbsBlockDeviceConfigs.
/**
* Creates a list of {@link EbsBlockDeviceConfig} from a given list of {@link EmrClusterDefinitionEbsBlockDeviceConfig}.
*
* @param emrClusterDefinitionEbsBlockDeviceConfigs the list of {@link EmrClusterDefinitionEbsBlockDeviceConfig}
*
* @return the list of {@link EbsBlockDeviceConfig}
*/
protected List<EbsBlockDeviceConfig> getEbsBlockDeviceConfigs(List<EmrClusterDefinitionEbsBlockDeviceConfig> emrClusterDefinitionEbsBlockDeviceConfigs) {
List<EbsBlockDeviceConfig> ebsBlockDeviceConfigs = null;
if (!CollectionUtils.isEmpty(emrClusterDefinitionEbsBlockDeviceConfigs)) {
ebsBlockDeviceConfigs = new ArrayList<>();
for (EmrClusterDefinitionEbsBlockDeviceConfig emrClusterDefinitionEbsBlockDeviceConfig : emrClusterDefinitionEbsBlockDeviceConfigs) {
if (emrClusterDefinitionEbsBlockDeviceConfig != null) {
EbsBlockDeviceConfig ebsBlockDeviceConfig = new EbsBlockDeviceConfig();
ebsBlockDeviceConfig.setVolumeSpecification(getVolumeSpecification(emrClusterDefinitionEbsBlockDeviceConfig.getVolumeSpecification()));
ebsBlockDeviceConfig.setVolumesPerInstance(emrClusterDefinitionEbsBlockDeviceConfig.getVolumesPerInstance());
ebsBlockDeviceConfigs.add(ebsBlockDeviceConfig);
}
}
}
return ebsBlockDeviceConfigs;
}
Aggregations