Search in sources :

Example 16 with OrchestratorStateParams

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

the class UpgradeCcmOrchestratorServiceTest method testDisableInvertingProxyAgent.

@Test
void testDisableInvertingProxyAgent() throws CloudbreakOrchestratorException {
    underTest.disableInvertingProxyAgent(STACK_ID);
    verify(hostOrchestrator).runOrchestratorState(paramCaptor.capture());
    OrchestratorStateParams params = paramCaptor.getValue();
    assertThat(params.getState()).isEqualTo("upgradeccm/disable-ccmv2");
    assertOtherStateParams(params);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Test(org.junit.jupiter.api.Test)

Example 17 with OrchestratorStateParams

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

the class UpgradeCcmOrchestratorServiceTest method testReconfigureNginx.

@Test
void testReconfigureNginx() throws CloudbreakOrchestratorException {
    underTest.reconfigureNginx(STACK_ID);
    verify(hostOrchestrator).runOrchestratorState(paramCaptor.capture());
    OrchestratorStateParams params = paramCaptor.getValue();
    assertThat(params.getState()).isEqualTo("nginx");
    assertOtherStateParams(params);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Test(org.junit.jupiter.api.Test)

Example 18 with OrchestratorStateParams

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

the class CreateFullBackupHandler method createOrchestratorStateParams.

private OrchestratorStateParams createOrchestratorStateParams(Stack stack, Set<Node> nodes) {
    GatewayConfig primaryGatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack);
    OrchestratorStateParams stateParameters = new OrchestratorStateParams();
    stateParameters.setPrimaryGatewayConfig(primaryGatewayConfig);
    stateParameters.setState("freeipa.backup-full");
    stateParameters.setAllNodes(nodes);
    LOGGER.debug("Created OrchestratorStateParams for running full backup: {}", stateParameters);
    return stateParameters;
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) GatewayConfig(com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)

Example 19 with OrchestratorStateParams

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

the class CreateFullBackupHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<CreateFullBackupEvent> event) {
    Stack stack = stackService.getByIdWithListsInTransaction(event.getData().getResourceId());
    MDCBuilder.buildMdcContext(stack);
    Set<Node> nodes = nodeService.mapInstancesToNodes(stack.getNotDeletedInstanceMetaDataSet());
    OrchestratorStateParams stateParameters = createOrchestratorStateParams(stack, nodes);
    try {
        runBackupForNodesSequentially(nodes, stateParameters);
        return new StackEvent(FullBackupEvent.FULL_BACKUP_SUCCESSFUL_EVENT.event(), event.getData().getResourceId());
    } catch (CloudbreakOrchestratorFailedException | CloneNotSupportedException e) {
        LOGGER.error("Full backup failed for node: {}", stateParameters.getTargetHostNames(), e);
        return new StackFailureEvent(FullBackupEvent.FULL_BACKUP_FAILED_EVENT.event(), event.getData().getResourceId(), e);
    }
}
Also used : CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) StackFailureEvent(com.sequenceiq.freeipa.flow.stack.StackFailureEvent) Node(com.sequenceiq.cloudbreak.common.orchestration.Node) OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Stack(com.sequenceiq.freeipa.entity.Stack)

Example 20 with OrchestratorStateParams

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

the class UpgradeCcmOrchestratorServiceTest method testDisableMina.

@Test
void testDisableMina() throws CloudbreakOrchestratorException {
    underTest.disableMina(STACK_ID);
    verify(hostOrchestrator).runOrchestratorState(paramCaptor.capture());
    OrchestratorStateParams params = paramCaptor.getValue();
    assertThat(params.getState()).isEqualTo("upgradeccm/disable-ccmv1");
    assertOtherStateParams(params);
}
Also used : OrchestratorStateParams(com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateParams) Test(org.junit.jupiter.api.Test)

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