Search in sources :

Example 16 with AmbariRepo

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());
    }
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails) CloudbreakDetails(com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails) CloudbreakImageNotFoundException(com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException) AmbariRepo(com.sequenceiq.cloudbreak.cloud.model.AmbariRepo) Image(com.sequenceiq.cloudbreak.cloud.model.Image)

Aggregations

AmbariRepo (com.sequenceiq.cloudbreak.cloud.model.AmbariRepo)16 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)7 HashMap (java.util.HashMap)4 CloudbreakDetails (com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails)3 Stack (com.sequenceiq.cloudbreak.domain.Stack)3 AmbariRepoDetailsJson (com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson)2 Image (com.sequenceiq.cloudbreak.cloud.model.Image)2 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)2 ClusterComponent (com.sequenceiq.cloudbreak.domain.ClusterComponent)2 Json (com.sequenceiq.cloudbreak.domain.json.Json)2 SaltConfig (com.sequenceiq.cloudbreak.orchestrator.model.SaltConfig)2 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 AmbariStackDetailsJson (com.sequenceiq.cloudbreak.api.model.AmbariStackDetailsJson)1 AmbariStackDetailsResponse (com.sequenceiq.cloudbreak.api.model.AmbariStackDetailsResponse)1 BlueprintInputJson (com.sequenceiq.cloudbreak.api.model.BlueprintInputJson)1 BlueprintParameterJson (com.sequenceiq.cloudbreak.api.model.BlueprintParameterJson)1 CloudbreakDetailsJson (com.sequenceiq.cloudbreak.api.model.CloudbreakDetailsJson)1 HostGroupAdjustmentJson (com.sequenceiq.cloudbreak.api.model.HostGroupAdjustmentJson)1 UserNamePasswordJson (com.sequenceiq.cloudbreak.api.model.UserNamePasswordJson)1