use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDPInfo in project cloudbreak by hortonworks.
the class ClusterCreationSetupService method defaultHDPInfo.
private StackInfo defaultHDPInfo(Blueprint blueprint, ClusterRequest request, IdentityUser user) {
try {
JsonNode root = getBlueprintJsonNode(blueprint, request, user);
if (root != null) {
String stackVersion = blueprintUtils.getBlueprintHdpVersion(root);
String stackName = blueprintUtils.getBlueprintStackName(root);
if ("HDF".equalsIgnoreCase(stackName)) {
LOGGER.info("Stack name is HDF, use the default HDF repo for version: " + stackVersion);
for (Entry<String, DefaultHDFInfo> entry : defaultHDFEntries.getEntries().entrySet()) {
if (entry.getKey().equals(stackVersion)) {
return entry.getValue();
}
}
} else {
LOGGER.info("Stack name is HDP, use the default HDP repo for version: " + stackVersion);
for (Entry<String, DefaultHDPInfo> entry : defaultHDPEntries.getEntries().entrySet()) {
if (entry.getKey().equals(stackVersion)) {
return entry.getValue();
}
}
}
}
} catch (IOException ex) {
LOGGER.warn("Can not initiate default hdp info: ", ex);
}
return defaultHDPEntries.getEntries().values().iterator().next();
}
Aggregations