use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class ClusterServicesRestartHandler method accept.
@Override
public void accept(Event<ClusterServicesRestartRequest> event) {
ClusterServicesRestartRequest request = event.getData();
ClusterServicesRestartResult result;
int requestId;
try {
Stack stack = stackService.getByIdWithListsInTransaction(request.getResourceId());
Optional<Stack> datalakeStack = datalakeService.getDatalakeStackByDatahubStack(stack);
CmTemplateProcessor blueprintProcessor = getCmTemplateProcessor(stack.getCluster());
if (datalakeStack.isPresent() && clusterServicesRestartService.isRDCRefreshNeeded(stack, datalakeStack.get())) {
LOGGER.info("Deploying client config and restarting services");
requestId = clusterServicesRestartService.refreshClusterOnRestart(stack, datalakeStack.get(), blueprintProcessor);
} else {
LOGGER.info("Restarting services");
requestId = apiConnectors.getConnector(stack).clusterModificationService().restartClusterServices();
}
result = new ClusterServicesRestartResult(request, requestId);
} catch (Exception e) {
result = new ClusterServicesRestartResult(e.getMessage(), e, request);
}
eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class StackStatusCheckerJob method getComputeHostGroups.
private Set<String> getComputeHostGroups(Cluster cluster) {
String blueprintText = cluster.getBlueprint().getBlueprintText();
CmTemplateProcessor blueprintProcessor = cmTemplateProcessorFactory.get(blueprintText);
Versioned blueprintVersion = () -> blueprintProcessor.getVersion().get();
return blueprintProcessor.getComputeHostGroups(blueprintVersion);
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class DasRdsConfigProvider method isRdsConfigNeeded.
@Override
protected boolean isRdsConfigNeeded(Blueprint blueprint, boolean hasGateway) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor blueprintProcessor = cmTemplateProcessorFactory.get(blueprintText);
return blueprintProcessor.isCMComponentExistsInBlueprint("DAS_EVENT_PROCESSOR") || blueprintProcessor.isCMComponentExistsInBlueprint("DAS_WEBAPP");
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class HueRdsConfigProvider method isRdsConfigNeedForHueServer.
private boolean isRdsConfigNeedForHueServer(Blueprint blueprint) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor blueprintProcessor = cmTemplateProcessorFactory.get(blueprintText);
return blueprintProcessor.isCMComponentExistsInBlueprint("HUE_SERVER") && blueprintProcessor.isCMComponentExistsInBlueprint("HUE_LOAD_BALANCER");
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class ProfilerAdminConfigProvider method isRdsConfigNeedForProfilerAdmin.
private boolean isRdsConfigNeedForProfilerAdmin(Blueprint blueprint) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor cmTemplateProcessor = cmTemplateProcessorFactory.get(blueprintText);
return cmTemplateProcessor.isCMComponentExistsInBlueprint("PROFILER_ADMIN_AGENT");
}
Aggregations