Search in sources :

Example 21 with StackRepoDetails

use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails 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

StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)21 AmbariRepo (com.sequenceiq.cloudbreak.cloud.model.AmbariRepo)7 Test (org.junit.Test)4 AmbariStackDetailsJson (com.sequenceiq.cloudbreak.api.model.AmbariStackDetailsJson)3 CloudbreakDetails (com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails)3 Image (com.sequenceiq.cloudbreak.cloud.model.Image)3 ClusterComponent (com.sequenceiq.cloudbreak.domain.ClusterComponent)3 Json (com.sequenceiq.cloudbreak.domain.json.Json)3 AmbariRepoDetailsJson (com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson)2 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)2 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)2 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)2 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)2 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)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