use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method saveHDPPillar.
private void saveHDPPillar(Long clusterId, Map<String, SaltPillarProperties> servicePillar) {
StackRepoDetails hdprepo = clusterComponentConfigProvider.getHDPRepo(clusterId);
servicePillar.put("hdp", new SaltPillarProperties("/hdp/repo.sls", singletonMap("hdp", hdprepo)));
}
use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails in project cloudbreak by hortonworks.
the class ImageService method createHDFRepo.
private StackRepoDetails createHDFRepo(StackDetails hdfStack) {
com.sequenceiq.cloudbreak.cloud.model.catalog.StackRepoDetails hdfRepo = hdfStack.getRepo();
StackRepoDetails repo = new StackRepoDetails();
repo.setHdpVersion(hdfStack.getVersion());
repo.setStack(hdfRepo.getStack());
repo.setUtil(hdfRepo.getUtil());
repo.setKnox(hdfRepo.getKnox());
return repo;
}
use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverter method convertComponentConfig.
private void convertComponentConfig(ClusterResponse response, Cluster source) {
try {
AmbariRepo ambariRepo = componentConfigProvider.getAmbariRepo(source.getComponents());
if (ambariRepo != null) {
AmbariRepoDetailsJson ambariRepoDetailsJson = getConversionService().convert(ambariRepo, AmbariRepoDetailsJson.class);
response.setAmbariRepoDetailsJson(ambariRepoDetailsJson);
}
StackRepoDetails stackRepoDetails = componentConfigProvider.getStackRepo(source.getComponents());
if (stackRepoDetails != null) {
AmbariStackDetailsResponse ambariRepoDetailsJson = getConversionService().convert(stackRepoDetails, AmbariStackDetailsResponse.class);
response.setAmbariStackDetails(ambariRepoDetailsJson);
}
} catch (RuntimeException e) {
LOGGER.error("Failed to convert dynamic component.", e);
}
}
use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails in project cloudbreak by hortonworks.
the class AmbariClusterService method createHDPRepoComponent.
private void createHDPRepoComponent(StackRepoDetails stackRepoDetailsUpdate, Stack stack) {
if (stackRepoDetailsUpdate != null) {
StackRepoDetails stackRepoDetails = clusterComponentConfigProvider.getHDPRepo(stack.getCluster().getId());
if (stackRepoDetails == null) {
try {
ClusterComponent clusterComp = new ClusterComponent(ComponentType.HDP_REPO_DETAILS, new Json(stackRepoDetailsUpdate), stack.getCluster());
clusterComponentConfigProvider.store(clusterComp);
} catch (JsonProcessingException ignored) {
throw new BadRequestException(String.format("HDP Repo parameters cannot be converted. %s", stackRepoDetailsUpdate));
}
} else {
ClusterComponent component = clusterComponentConfigProvider.getComponent(stack.getCluster().getId(), ComponentType.HDP_REPO_DETAILS);
stackRepoDetails.setHdpVersion(stackRepoDetailsUpdate.getHdpVersion());
stackRepoDetails.setVerify(stackRepoDetailsUpdate.isVerify());
stackRepoDetails.setStack(stackRepoDetailsUpdate.getStack());
stackRepoDetails.setUtil(stackRepoDetailsUpdate.getUtil());
stackRepoDetails.setEnableGplRepo(stackRepoDetailsUpdate.isEnableGplRepo());
stackRepoDetails.setKnox(stackRepoDetailsUpdate.getKnox());
try {
component.setAttributes(new Json(stackRepoDetails));
clusterComponentConfigProvider.store(component);
} catch (JsonProcessingException ignored) {
throw new BadRequestException(String.format("HDP Repo parameters cannot be converted. %s", stackRepoDetailsUpdate));
}
}
}
}
use of com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails in project cloudbreak by hortonworks.
the class AmbariRepositoryVersionService method getRepositoryVersion.
public String getRepositoryVersion(long clusterId, Orchestrator orchestrator) throws CloudbreakException {
StackRepoDetails stackRepoDetails = getStackRepoDetails(clusterId, orchestrator);
AmbariRepo ambariRepoDetails = clusterComponentConfigProvider.getAmbariRepo(clusterId);
String result = "";
if (stackRepoDetails != null && isVersionNewerOrEqualThanLimited(ambariRepoDetails::getVersion, AMBARI_VERSION_2_6_0_0)) {
Optional<String> repositoryVersion = Optional.ofNullable(stackRepoDetails.getStack().get(StackRepoDetails.REPOSITORY_VERSION));
result = repositoryVersion.orElse("");
}
return result;
}
Aggregations