use of com.amazonaws.services.elasticmapreduce.model.BootstrapActionConfig in project herd by FINRAOS.
the class EmrDaoImpl method addHadoopBootstrapActionConfig.
private void addHadoopBootstrapActionConfig(EmrClusterDefinition emrClusterDefinition, ArrayList<BootstrapActionConfig> bootstrapActions) {
// Add hadoop Configuration support if needed
if (!CollectionUtils.isEmpty(emrClusterDefinition.getHadoopConfigurations())) {
ArrayList<String> argList = new ArrayList<>();
BootstrapActionConfig hadoopBootstrapActionConfig = getBootstrapActionConfig(ConfigurationValue.EMR_CONFIGURE_HADOOP.getKey(), configurationHelper.getProperty(ConfigurationValue.EMR_CONFIGURE_HADOOP));
// If config files are available, add them as arguments
for (Object hadoopConfigObject : emrClusterDefinition.getHadoopConfigurations()) {
// If the Config Files are available, add them as arguments
if (hadoopConfigObject instanceof ConfigurationFiles) {
for (ConfigurationFile configurationFile : ((ConfigurationFiles) hadoopConfigObject).getConfigurationFiles()) {
argList.add(configurationFile.getFileNameShortcut());
argList.add(configurationFile.getConfigFileLocation());
}
}
// If the key value pairs are available, add them as arguments
if (hadoopConfigObject instanceof KeyValuePairConfigurations) {
for (KeyValuePairConfiguration keyValuePairConfiguration : ((KeyValuePairConfigurations) hadoopConfigObject).getKeyValuePairConfigurations()) {
argList.add(keyValuePairConfiguration.getKeyValueShortcut());
argList.add(keyValuePairConfiguration.getAttribKey() + "=" + keyValuePairConfiguration.getAttribVal());
}
}
}
// Add the bootstrap action with arguments
hadoopBootstrapActionConfig.getScriptBootstrapAction().setArgs(argList);
bootstrapActions.add(hadoopBootstrapActionConfig);
}
}
Aggregations