use of com.sequenceiq.cloudbreak.template.validation.BlueprintValidator in project cloudbreak by hortonworks.
the class ClusterDecorator method validateBlueprintIfRequired.
private void validateBlueprintIfRequired(Cluster subject, ClusterV4Request request, Stack stack) {
BlueprintValidator blueprintValidator = blueprintValidatorFactory.createBlueprintValidator(subject.getBlueprint());
blueprintValidator.validate(subject.getBlueprint(), subject.getHostGroups(), stack.getInstanceGroups(), request.getValidateBlueprint());
}
use of com.sequenceiq.cloudbreak.template.validation.BlueprintValidator in project cloudbreak by hortonworks.
the class ClusterOperationService method recreate.
public FlowIdentifier recreate(Stack stack, String blueprintName, Set<HostGroup> hostGroups, boolean validateBlueprint) throws TransactionExecutionException {
return transactionService.required(() -> {
checkBlueprintIdAndHostGroups(blueprintName, hostGroups);
Stack stackWithLists = stackService.getByIdWithListsInTransaction(stack.getId());
Cluster cluster = stackWithLists.getCluster();
Blueprint blueprint = blueprintService.getByNameForWorkspace(blueprintName, stack.getWorkspace());
if (!clusterService.withEmbeddedClusterManagerDB(cluster)) {
throw new BadRequestException("Cluster Manager doesn't support resetting external DB automatically. To reset Cluster Manager schema you " + "must first drop and then create it using DDL scripts from /opt/cloudera/cm/schema/postgresql/");
}
BlueprintValidator blueprintValidator = blueprintValidatorFactory.createBlueprintValidator(blueprint);
blueprintValidator.validate(blueprint, hostGroups, stackWithLists.getInstanceGroups(), validateBlueprint);
clusterService.prepareCluster(hostGroups, blueprint, stackWithLists, cluster);
clusterService.updateClusterStatusByStackId(stack.getId(), DetailedStackStatus.CLUSTER_RECREATE_REQUESTED);
return triggerClusterInstall(stackWithLists);
});
}
Aggregations