use of com.sequenceiq.cloudbreak.cloud.model.AmbariRepo in project cloudbreak by hortonworks.
the class StackToStackDetailsConverter method convertComponents.
private void convertComponents(StackDetails stackDetails, Stack stack) {
Long stackId = stack.getId();
CloudbreakDetails cloudbreakDetails = componentConfigProvider.getCloudbreakDetails(stackId);
if (cloudbreakDetails != null) {
stackDetails.setCloudbreakVersion(cloudbreakDetails.getVersion());
}
try {
Image image = componentConfigProvider.getImage(stackId);
stackDetails.setImageIdentifier(image.getImageName());
} catch (CloudbreakImageNotFoundException e) {
LOGGER.warn("Image not found! {}", e.getMessage());
}
AmbariRepo ambariRepo = componentConfigProvider.getAmbariRepo(stackId);
if (ambariRepo != null) {
stackDetails.setPrewarmedImage(ambariRepo.getPredefined());
stackDetails.setAmbariVersion(ambariRepo.getVersion());
} else {
stackDetails.setPrewarmedImage(Boolean.FALSE);
}
StackRepoDetails stackRepoDetails = componentConfigProvider.getHDPRepo(stackId);
if (stackRepoDetails != null) {
stackDetails.setClusterType(stackRepoDetails.getStack().get(StackRepoDetails.REPO_ID_TAG));
stackDetails.setClusterVersion(stackRepoDetails.getHdpVersion());
}
}
Aggregations