use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class ProfilerMetricsConfigProvider method isRdsConfigNeedForProfilerMetrics.
private boolean isRdsConfigNeedForProfilerMetrics(Blueprint blueprint) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor cmTemplateProcessor = cmTemplateProcessorFactory.get(blueprintText);
return cmTemplateProcessor.isCMComponentExistsInBlueprint("PROFILER_METRICS_AGENT");
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class QueryProcessorRdsConfigProvider method isRdsConfigNeeded.
@Override
protected boolean isRdsConfigNeeded(Blueprint blueprint, boolean hasGateway) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor blueprintProcessor = cmTemplateProcessorFactory.get(blueprintText);
return blueprintProcessor.isCMComponentExistsInBlueprint("QUERY_PROCESSOR");
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class RangerRdsConfigProvider method isRdsConfigNeedForRangerAdmin.
private boolean isRdsConfigNeedForRangerAdmin(Blueprint blueprint) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor blueprintProcessor = cmTemplateProcessorFactory.get(blueprintText);
return blueprintProcessor.isCMComponentExistsInBlueprint("RANGER_ADMIN");
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class ClouderaManagerDeregisterService method deregisterServices.
public void deregisterServices(HttpClientConfig clientConfig, Stack stack, Optional<DatalakeDto> datalakeDto) {
Cluster cluster = stack.getCluster();
String user = cluster.getCloudbreakAmbariUser();
String password = cluster.getCloudbreakAmbariPassword();
ClouderaManagerRepo clouderaManagerRepoDetails = clusterComponentConfigProvider.getClouderaManagerRepoDetails(cluster.getId());
try {
CmTemplateProcessor cmTemplateProcessor = cmTemplateProcessorFactory.get(stack.getCluster().getBlueprint().getBlueprintText());
if (CMRepositoryVersionUtil.isRangerTearDownSupported(clouderaManagerRepoDetails)) {
if (datalakeDto.isPresent()) {
LOGGER.info("The current cluster {} is a Data Hub cluster so teardown REQUIRED.", stack.getName());
DatalakeDto datalake = datalakeDto.get();
ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(datalakeClient(datalake));
clustersResourceApi.tearDownWorkloadCluster(datalake.getName(), stack.getName());
} else {
LOGGER.info("The current cluster {} is a Data Lake cluster so teardown NOT_REQUIRED.", stack.getName());
}
} else {
ApiClient client = clouderaManagerApiClientProvider.getV31Client(stack.getGatewayPort(), user, password, clientConfig);
if (cmTemplateProcessor.isCMComponentExistsInBlueprint(COMPONENT_NIFI_REGISTRY_SERVER)) {
LOGGER.info("The current cluster {} contains NIFI_REGISTRY_SERVER and ranger teardown not supported. " + "CDP will call RemoveRangerRepo command.", stack.getName());
clouderaManagerApiFactory.getServicesResourceApi(client).serviceCommandByName(stack.getName(), "RemoveRangerRepo", SERVICE_NIFIREGISTRY);
}
if (cmTemplateProcessor.isCMComponentExistsInBlueprint(COMPONENT_NIFI_NODE)) {
LOGGER.info("The current cluster {} contains NIFI_NODE and ranger teardown not supported. " + "CDP will call RemoveRangerRepo command.", stack.getName());
clouderaManagerApiFactory.getServicesResourceApi(client).serviceCommandByName(stack.getName(), "RemoveRangerRepo", SERVICE_NIFI);
}
}
} catch (Exception e) {
LOGGER.warn("Couldn't remove services. This has to be done manually." + " It's possible that CM or the instance is not running. Notification is sent to the UI.", e);
cloudbreakEventService.fireCloudbreakEvent(stack.getId(), stack.getStatus().name(), ResourceEvent.CLUSTER_CM_SECURITY_GROUP_TOO_STRICT, List.of(e.getMessage()));
}
}
use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.
the class ClouderaManagerBlueprintPortConfigCollector method getServicePorts.
public Map<String, Integer> getServicePorts(Blueprint blueprint, boolean tls) {
String blueprintText = blueprint.getBlueprintText();
CmTemplateProcessor processor = cmTemplateProcessorFactory.get(blueprintText);
return exposedServiceCollector.getAllServicePorts(processor.getVersion(), tls);
}
Aggregations