Search in sources :

Example 1 with DefaultHDFInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDFInfo 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();
}
Also used : DefaultHDPInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDPInfo) JsonNode(com.fasterxml.jackson.databind.JsonNode) IOException(java.io.IOException) DefaultHDFInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDFInfo)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 DefaultHDFInfo (com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDFInfo)1 DefaultHDPInfo (com.sequenceiq.cloudbreak.cloud.model.component.DefaultHDPInfo)1 IOException (java.io.IOException)1