Search in sources :

Example 6 with ClusterDeletionBasedExitCriteriaModel

use of com.sequenceiq.cloudbreak.core.bootstrap.service.ClusterDeletionBasedExitCriteriaModel in project cloudbreak by hortonworks.

the class UpgradeCcmOrchestratorService method createStateParams.

private OrchestratorStateParams createStateParams(Long stackId, String saltState) {
    Stack stack = stackService.getByIdWithListsInTransaction(stackId);
    Set<Node> gatewayNodes = stackUtil.collectGatewayNodes(stack);
    OrchestratorStateParams stateParams = new OrchestratorStateParams();
    stateParams.setState(saltState);
    stateParams.setPrimaryGatewayConfig(gatewayConfigService.getPrimaryGatewayConfig(stack));
    stateParams.setTargetHostNames(gatewayNodes.stream().map(Node::getHostname).collect(Collectors.toSet()));
    stateParams.setAllNodes(gatewayNodes);
    stateParams.setExitCriteriaModel(new ClusterDeletionBasedExitCriteriaModel(stack.getId(), stack.getCluster().getId()));
    return stateParams;
}
Also used : Node(com.sequenceiq.cloudbreak.common.orchestration.Node) ClusterDeletionBasedExitCriteriaModel(com.sequenceiq.cloudbreak.core.bootstrap.service.ClusterDeletionBasedExitCriteriaModel) OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack)

Aggregations

ClusterDeletionBasedExitCriteriaModel (com.sequenceiq.cloudbreak.core.bootstrap.service.ClusterDeletionBasedExitCriteriaModel)6 Node (com.sequenceiq.cloudbreak.common.orchestration.Node)5 GatewayConfig (com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)5 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)4 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)2 OrchestratorStateParams (com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams)1 OrchestratorMetadata (com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata)1 OrchestratorMetadataFilter (com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadataFilter)1 ExitCriteriaModel (com.sequenceiq.cloudbreak.orchestrator.state.ExitCriteriaModel)1 CloudbreakRuntimeException (com.sequenceiq.cloudbreak.service.CloudbreakRuntimeException)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1