Search in sources :

Example 1 with EmrClusterDefinitionVolumeSpecification

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

the class EmrDaoImplTest method testGetVolumeSpecification.

@Test
public void testGetVolumeSpecification() {
    // Call the method under test.
    VolumeSpecification result = emrDaoImpl.getVolumeSpecification(new EmrClusterDefinitionVolumeSpecification(VOLUME_TYPE, IOPS, SIZE_IN_GB));
    // Verify the external calls.
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(new VolumeSpecification().withVolumeType(VOLUME_TYPE).withIops(IOPS).withSizeInGB(SIZE_IN_GB), result);
}
Also used : VolumeSpecification(com.amazonaws.services.elasticmapreduce.model.VolumeSpecification) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification) Test(org.junit.Test) AbstractDaoTest(org.finra.herd.dao.AbstractDaoTest)

Example 2 with EmrClusterDefinitionVolumeSpecification

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

the class EmrDaoImpl method getVolumeSpecification.

/**
 * Creates an instance of {@link VolumeSpecification} from a given instance of {@link EmrClusterDefinitionVolumeSpecification}.
 *
 * @param emrClusterDefinitionVolumeSpecification the instance of {@link EmrClusterDefinitionVolumeSpecification}
 *
 * @return the instance of {@link VolumeSpecification}
 */
protected VolumeSpecification getVolumeSpecification(EmrClusterDefinitionVolumeSpecification emrClusterDefinitionVolumeSpecification) {
    VolumeSpecification volumeSpecification = null;
    if (emrClusterDefinitionVolumeSpecification != null) {
        volumeSpecification = new VolumeSpecification();
        volumeSpecification.setVolumeType(emrClusterDefinitionVolumeSpecification.getVolumeType());
        volumeSpecification.setIops(emrClusterDefinitionVolumeSpecification.getIops());
        volumeSpecification.setSizeInGB(emrClusterDefinitionVolumeSpecification.getSizeInGB());
    }
    return volumeSpecification;
}
Also used : VolumeSpecification(com.amazonaws.services.elasticmapreduce.model.VolumeSpecification) EmrClusterDefinitionVolumeSpecification(org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification)

Example 3 with EmrClusterDefinitionVolumeSpecification

use of org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification 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 EmrClusterDefinitionVolumeSpecification

use of org.finra.herd.model.api.xml.EmrClusterDefinitionVolumeSpecification 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)

Example 5 with EmrClusterDefinitionVolumeSpecification

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

Aggregations

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