Search in sources :

Example 1 with EmrClusterDefinitionEbsConfiguration

use of org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration 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);
}
Also used : EmrClusterDefinitionInstanceTypeConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionInstanceTypeConfig) EmrClusterDefinitionConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionConfiguration) Configuration(com.amazonaws.services.elasticmapreduce.model.Configuration) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EbsConfiguration(com.amazonaws.services.elasticmapreduce.model.EbsConfiguration) EmrClusterDefinitionConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionConfiguration) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) InstanceTypeConfig(com.amazonaws.services.elasticmapreduce.model.InstanceTypeConfig) EmrClusterDefinitionInstanceTypeConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionInstanceTypeConfig) Test(org.junit.Test) AbstractDaoTest(org.finra.herd.dao.AbstractDaoTest)

Example 2 with EmrClusterDefinitionEbsConfiguration

use of org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration in project herd by FINRAOS.

the class EmrDaoImpl method getEbsConfiguration.

/**
 * Creates an instance of {@link EbsConfiguration} from a given instance of {@link EmrClusterDefinitionEbsConfiguration}.
 *
 * @param emrClusterDefinitionEbsConfiguration the instance of {@link EmrClusterDefinitionEbsConfiguration}
 *
 * @return the instance of {@link EbsConfiguration}
 */
protected EbsConfiguration getEbsConfiguration(EmrClusterDefinitionEbsConfiguration emrClusterDefinitionEbsConfiguration) {
    EbsConfiguration ebsConfiguration = null;
    if (emrClusterDefinitionEbsConfiguration != null) {
        ebsConfiguration = new EbsConfiguration();
        ebsConfiguration.setEbsBlockDeviceConfigs(getEbsBlockDeviceConfigs(emrClusterDefinitionEbsConfiguration.getEbsBlockDeviceConfigs()));
        ebsConfiguration.setEbsOptimized(emrClusterDefinitionEbsConfiguration.isEbsOptimized());
    }
    return ebsConfiguration;
}
Also used : EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EbsConfiguration(com.amazonaws.services.elasticmapreduce.model.EbsConfiguration)

Example 3 with EmrClusterDefinitionEbsConfiguration

use of org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration 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);
}
Also used : VolumeSpecification(com.amazonaws.services.elasticmapreduce.model.VolumeSpecification) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EbsConfiguration(com.amazonaws.services.elasticmapreduce.model.EbsConfiguration) EmrClusterDefinitionEbsBlockDeviceConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsBlockDeviceConfig) EbsBlockDeviceConfig(com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig) EmrClusterDefinitionEbsBlockDeviceConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsBlockDeviceConfig) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) InstanceGroupConfig(com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig) Test(org.junit.Test) AbstractDaoTest(org.finra.herd.dao.AbstractDaoTest)

Example 4 with EmrClusterDefinitionEbsConfiguration

use of org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration 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);
}
Also used : VolumeSpecification(com.amazonaws.services.elasticmapreduce.model.VolumeSpecification) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EbsConfiguration(com.amazonaws.services.elasticmapreduce.model.EbsConfiguration) EmrClusterDefinitionEbsBlockDeviceConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsBlockDeviceConfig) EbsBlockDeviceConfig(com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig) EmrClusterDefinitionEbsBlockDeviceConfig(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsBlockDeviceConfig) EmrClusterDefinitionEbsConfiguration(org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) Test(org.junit.Test) AbstractDaoTest(org.finra.herd.dao.AbstractDaoTest)

Aggregations

EbsConfiguration (com.amazonaws.services.elasticmapreduce.model.EbsConfiguration)4 EmrClusterDefinitionEbsConfiguration (org.finra.herd.model.api.xml.EmrClusterDefinitionEbsConfiguration)4 AbstractDaoTest (org.finra.herd.dao.AbstractDaoTest)3 Test (org.junit.Test)3 EbsBlockDeviceConfig (com.amazonaws.services.elasticmapreduce.model.EbsBlockDeviceConfig)2 VolumeSpecification (com.amazonaws.services.elasticmapreduce.model.VolumeSpecification)2 EmrClusterDefinitionEbsBlockDeviceConfig (org.finra.herd.model.api.xml.EmrClusterDefinitionEbsBlockDeviceConfig)2 EmrClusterDefinitionVolumeSpecification (org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification)2 Configuration (com.amazonaws.services.elasticmapreduce.model.Configuration)1 InstanceGroupConfig (com.amazonaws.services.elasticmapreduce.model.InstanceGroupConfig)1 InstanceTypeConfig (com.amazonaws.services.elasticmapreduce.model.InstanceTypeConfig)1 EmrClusterDefinitionConfiguration (org.finra.herd.model.api.xml.EmrClusterDefinitionConfiguration)1 EmrClusterDefinitionInstanceTypeConfig (org.finra.herd.model.api.xml.EmrClusterDefinitionInstanceTypeConfig)1