use of com.sequenceiq.cloudbreak.blueprint.HostgroupEntry in project cloudbreak by hortonworks.
the class HostgroupConfigurations method fromConfigEntryMap.
public static HostgroupConfigurations fromConfigEntryMap(Map<HostgroupEntry, List<BlueprintConfigurationEntry>> configuration) {
HostgroupConfigurations result = new HostgroupConfigurations();
for (Map.Entry<HostgroupEntry, List<BlueprintConfigurationEntry>> conf : configuration.entrySet()) {
Map<String, Map<String, String>> config = new HashMap<>();
for (BlueprintConfigurationEntry blueprintConfigurationEntry : conf.getValue()) {
if (!config.keySet().contains(blueprintConfigurationEntry.getConfigFile())) {
config.put(blueprintConfigurationEntry.getConfigFile(), new HashMap<>());
}
config.get(blueprintConfigurationEntry.getConfigFile()).put(blueprintConfigurationEntry.getKey(), blueprintConfigurationEntry.getValue());
}
result.addHostgroupConfiguration(new HostgroupConfiguration(conf.getKey().getHostGroup(), config));
}
return result;
}
Aggregations