Search in sources :

Example 11 with OrchestratorStateParams

use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.

the class UpgradeCcmOrchestratorService method applyUpgradeState.

public void applyUpgradeState(Long stackId) throws CloudbreakOrchestratorException {
    OrchestratorStateParams stateParams = createStateParams(stackId, UPGRADE_CCM_STATE);
    LOGGER.debug("Calling applyUpgradeState with state params '{}'", stateParams);
    hostOrchestrator.runOrchestratorState(stateParams);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams)

Example 12 with OrchestratorStateParams

use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.

the class UpgradeCcmOrchestratorService method disableMina.

public void disableMina(Long stackId) throws CloudbreakOrchestratorException {
    OrchestratorStateParams stateParams = createStateParams(stackId, DISABLE_MINA_STATE);
    LOGGER.debug("Calling disableMina with state params '{}'", stateParams);
    hostOrchestrator.runOrchestratorState(stateParams);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams)

Example 13 with OrchestratorStateParams

use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.

the class UpgradeCcmOrchestratorService method createStateParams.

private OrchestratorStateParams createStateParams(Long stackId, String saltState) {
    Stack stack = stackService.getByIdWithListsInTransaction(stackId);
    Set<InstanceMetaData> instanceMetaDatas = stack.getNotDeletedInstanceMetaDataSet();
    Set<Node> allNodes = freeIpaNodeUtilService.mapInstancesToNodes(instanceMetaDatas);
    OrchestratorStateParams stateParams = new OrchestratorStateParams();
    stateParams.setState(saltState);
    stateParams.setPrimaryGatewayConfig(gatewayConfigService.getPrimaryGatewayConfig(stack));
    stateParams.setTargetHostNames(allNodes.stream().map(Node::getHostname).collect(Collectors.toSet()));
    stateParams.setAllNodes(allNodes);
    stateParams.setExitCriteriaModel(new StackBasedExitCriteriaModel(stack.getId()));
    return stateParams;
}
Also used : InstanceMetaData(com.sequenceiq.freeipa.entity.InstanceMetaData) Node(com.sequenceiq.cloudbreak.common.orchestration.Node) StackBasedExitCriteriaModel(com.sequenceiq.freeipa.orchestrator.StackBasedExitCriteriaModel) OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Stack(com.sequenceiq.freeipa.entity.Stack)

Example 14 with OrchestratorStateParams

use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams in project cloudbreak by hortonworks.

the class UpgradeCcmOrchestratorService method disableInvertingProxyAgent.

public void disableInvertingProxyAgent(Long stackId) throws CloudbreakOrchestratorException {
    OrchestratorStateParams stateParams = createStateParams(stackId, DISABLE_INVERTING_PROXY_AGENT_STATE);
    LOGGER.debug("Calling disableInvertingProxyAgent with state params '{}'", stateParams);
    hostOrchestrator.runOrchestratorState(stateParams);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams)

Example 15 with OrchestratorStateParams

use of com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams 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

OrchestratorStateParams (com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams)21 Test (org.junit.jupiter.api.Test)7 Node (com.sequenceiq.cloudbreak.common.orchestration.Node)6 Stack (com.sequenceiq.freeipa.entity.Stack)3 GatewayConfig (com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)2 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)2 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)2 ClusterDeletionBasedExitCriteriaModel (com.sequenceiq.cloudbreak.core.bootstrap.service.ClusterDeletionBasedExitCriteriaModel)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)1 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)1 OrchestratorStateRetryParams (com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateRetryParams)1 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)1 CreateFullBackupEvent (com.sequenceiq.freeipa.flow.freeipa.backup.full.event.CreateFullBackupEvent)1 StackFailureEvent (com.sequenceiq.freeipa.flow.stack.StackFailureEvent)1 StackBasedExitCriteriaModel (com.sequenceiq.freeipa.orchestrator.StackBasedExitCriteriaModel)1