private void addHadoopBootstrapActionConfig(EmrClusterDefinition emrClusterDefinition, ArrayList<BootstrapActionConfig> bootstrapActions) if (!CollectionUtils.isEmpty(emrClusterDefinition.getHadoopConfigurations())) configurationHelper.getProperty(ConfigurationValue.EMR_CONFIGURE_HADOOP)); for (Object hadoopConfigObject : emrClusterDefinition.getHadoopConfigurations())
private void addHadoopBootstrapActionConfig(EmrClusterDefinition emrClusterDefinition, ArrayList<BootstrapActionConfig> bootstrapActions) if (!CollectionUtils.isEmpty(emrClusterDefinition.getHadoopConfigurations())) configurationHelper.getProperty(ConfigurationValue.EMR_CONFIGURE_HADOOP)); for (Object hadoopConfigObject : emrClusterDefinition.getHadoopConfigurations())
@Test public void testCreateEmrClusterOverrideHadoopConfigurations() throws Exception { // Create the namespace entity. NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE); String definitionXml = IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()); EmrClusterDefinition expectedEmrClusterDefinition = xmlHelper.unmarshallXmlToObject(EmrClusterDefinition.class, definitionXml); emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME, definitionXml); // Create a new EMR cluster create request EmrClusterCreateRequest request = getNewEmrClusterCreateRequest(); EmrClusterDefinition emrClusterDefinitionOverride = new EmrClusterDefinition(); ArrayList<Serializable> hadoopConfigurations = new ArrayList<>(); hadoopConfigurations.add(new ConfigurationFiles()); hadoopConfigurations.add(new KeyValuePairConfigurations()); emrClusterDefinitionOverride.setHadoopConfigurations(hadoopConfigurations); expectedEmrClusterDefinition.setHadoopConfigurations(emrClusterDefinitionOverride.getHadoopConfigurations()); request.setEmrClusterDefinitionOverride(emrClusterDefinitionOverride); EmrCluster emrCluster = emrService.createCluster(request); // Validate the returned object against the input. assertNotNull(emrCluster); assertTrue(emrCluster.getNamespace().equals(request.getNamespace())); assertTrue(emrCluster.getEmrClusterDefinitionName().equals(request.getEmrClusterDefinitionName())); assertTrue(emrCluster.getEmrClusterName().equals(request.getEmrClusterName())); assertNotNull(emrCluster.getId()); assertNull(emrCluster.isDryRun()); assertTrue(emrCluster.isEmrClusterCreated()); assertNotNull(emrCluster.getEmrClusterDefinition()); assertEquals(expectedEmrClusterDefinition, emrCluster.getEmrClusterDefinition()); validateEmrClusterCreationLogUnique(emrCluster, expectedEmrClusterDefinition); }
expectedEmrClusterDefinition.setDaemonConfigurations(emrClusterDefinitionOverride.getDaemonConfigurations()); emrClusterDefinitionOverride.setHadoopConfigurations(Collections.<Serializable>emptyList()); expectedEmrClusterDefinition.setHadoopConfigurations(emrClusterDefinitionOverride.getHadoopConfigurations()); emrClusterDefinitionOverride.setHadoopJarSteps(Collections.<HadoopJarStep>emptyList()); expectedEmrClusterDefinition.setHadoopJarSteps(emrClusterDefinitionOverride.getHadoopJarSteps());
if (emrClusterDefinitionOverride.getHadoopConfigurations() != null) emrClusterDefinition.setHadoopConfigurations(emrClusterDefinitionOverride.getHadoopConfigurations());
if (emrClusterDefinitionOverride.getHadoopConfigurations() != null) emrClusterDefinition.setHadoopConfigurations(emrClusterDefinitionOverride.getHadoopConfigurations());
lhsHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); List<Serializable> rhsHadoopConfigurations; rhsHadoopConfigurations = ((that.hadoopConfigurations!= null)?that.getHadoopConfigurations():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "hadoopConfigurations", lhsHadoopConfigurations), LocatorUtils.property(thatLocator, "hadoopConfigurations", rhsHadoopConfigurations), lhsHadoopConfigurations, rhsHadoopConfigurations, (this.hadoopConfigurations!= null), (that.hadoopConfigurations!= null))) { return false;
lhsHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); List<Serializable> rhsHadoopConfigurations; rhsHadoopConfigurations = ((that.hadoopConfigurations!= null)?that.getHadoopConfigurations():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "hadoopConfigurations", lhsHadoopConfigurations), LocatorUtils.property(thatLocator, "hadoopConfigurations", rhsHadoopConfigurations), lhsHadoopConfigurations, rhsHadoopConfigurations, (this.hadoopConfigurations!= null), (that.hadoopConfigurations!= null))) { return false;
lhsHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); List<Serializable> rhsHadoopConfigurations; rhsHadoopConfigurations = ((that.hadoopConfigurations!= null)?that.getHadoopConfigurations():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "hadoopConfigurations", lhsHadoopConfigurations), LocatorUtils.property(thatLocator, "hadoopConfigurations", rhsHadoopConfigurations), lhsHadoopConfigurations, rhsHadoopConfigurations, (this.hadoopConfigurations!= null), (that.hadoopConfigurations!= null))) { return false;
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); strategy.appendField(locator, this, "hadoopConfigurations", buffer, theHadoopConfigurations, (this.hadoopConfigurations!= null));
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); strategy.appendField(locator, this, "hadoopConfigurations", buffer, theHadoopConfigurations, (this.hadoopConfigurations!= null));
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); strategy.appendField(locator, this, "hadoopConfigurations", buffer, theHadoopConfigurations, (this.hadoopConfigurations!= null));
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "hadoopConfigurations", theHadoopConfigurations), currentHashCode, theHadoopConfigurations, (this.hadoopConfigurations!= null));
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "hadoopConfigurations", theHadoopConfigurations), currentHashCode, theHadoopConfigurations, (this.hadoopConfigurations!= null));
theHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "hadoopConfigurations", theHadoopConfigurations), currentHashCode, theHadoopConfigurations, (this.hadoopConfigurations!= null));
if (hadoopConfigurationsShouldBeCopiedAndSet == Boolean.TRUE) { List<Serializable> sourceHadoopConfigurations; sourceHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); @SuppressWarnings("unchecked") List<Serializable> copyHadoopConfigurations = ((List<Serializable> ) strategy.copy(LocatorUtils.property(locator, "hadoopConfigurations", sourceHadoopConfigurations), sourceHadoopConfigurations, (this.hadoopConfigurations!= null)));
if (hadoopConfigurationsShouldBeCopiedAndSet == Boolean.TRUE) { List<Serializable> sourceHadoopConfigurations; sourceHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); @SuppressWarnings("unchecked") List<Serializable> copyHadoopConfigurations = ((List<Serializable> ) strategy.copy(LocatorUtils.property(locator, "hadoopConfigurations", sourceHadoopConfigurations), sourceHadoopConfigurations, (this.hadoopConfigurations!= null)));
if (hadoopConfigurationsShouldBeCopiedAndSet == Boolean.TRUE) { List<Serializable> sourceHadoopConfigurations; sourceHadoopConfigurations = ((this.hadoopConfigurations!= null)?this.getHadoopConfigurations():null); @SuppressWarnings("unchecked") List<Serializable> copyHadoopConfigurations = ((List<Serializable> ) strategy.copy(LocatorUtils.property(locator, "hadoopConfigurations", sourceHadoopConfigurations), sourceHadoopConfigurations, (this.hadoopConfigurations!= null)));