Search in sources :

Example 6 with StateRunner

use of com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.StateRunner in project cloudbreak by hortonworks.

the class SaltTelemetryOrchestrator method runSimpleSaltState.

private void runSimpleSaltState(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel, String saltState, String errorMessage, int retryCount, boolean retryOnFail) throws CloudbreakOrchestratorFailedException {
    GatewayConfig primaryGateway = saltService.getPrimaryGatewayConfig(allGateways);
    Set<String> targetHostnames = nodes.stream().map(Node::getHostname).collect(Collectors.toSet());
    try (SaltConnector sc = saltService.createSaltConnector(primaryGateway)) {
        StateRunner stateRunner = new StateRunner(targetHostnames, nodes, saltState);
        OrchestratorBootstrap saltJobIdTracker = new SaltJobIdTracker(sc, stateRunner, retryOnFail);
        Callable<Boolean> saltJobRunBootstrapRunner = saltRunner.runner(saltJobIdTracker, exitCriteria, exitModel, retryCount, false);
        saltJobRunBootstrapRunner.call();
    } catch (Exception e) {
        LOGGER.debug(errorMessage, e);
        throw new CloudbreakOrchestratorFailedException(e);
    }
}
Also used : CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) OrchestratorBootstrap(com.sequenceiq.cloudbreak.orchestrator.OrchestratorBootstrap) SaltJobIdTracker(com.sequenceiq.cloudbreak.orchestrator.salt.poller.SaltJobIdTracker) ParameterizedStateRunner(com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.ParameterizedStateRunner) ConcurrentParameterizedStateRunner(com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.ConcurrentParameterizedStateRunner) StateRunner(com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.StateRunner) SaltConnector(com.sequenceiq.cloudbreak.orchestrator.salt.client.SaltConnector) CloudbreakOrchestratorException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException) UncheckedIOException(java.io.UncheckedIOException) CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) GatewayConfig(com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)

Aggregations

OrchestratorBootstrap (com.sequenceiq.cloudbreak.orchestrator.OrchestratorBootstrap)6 CloudbreakOrchestratorException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException)6 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)6 SaltConnector (com.sequenceiq.cloudbreak.orchestrator.salt.client.SaltConnector)6 SaltJobIdTracker (com.sequenceiq.cloudbreak.orchestrator.salt.poller.SaltJobIdTracker)6 ConcurrentParameterizedStateRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.ConcurrentParameterizedStateRunner)6 ParameterizedStateRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.ParameterizedStateRunner)6 StateRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.StateRunner)6 IOException (java.io.IOException)6 ExecutionException (java.util.concurrent.ExecutionException)6 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)5 NotFoundException (com.sequenceiq.cloudbreak.common.exception.NotFoundException)5 CloudbreakOrchestratorTimeoutException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorTimeoutException)5 HighStateRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.HighStateRunner)5 OrchestratorStateRetryParams (com.sequenceiq.cloudbreak.orchestrator.host.OrchestratorStateRetryParams)1 GatewayConfig (com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)1 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)1 GrainAddRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.GrainAddRunner)1 GrainRemoveRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.GrainRemoveRunner)1 HighStateAllRunner (com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker.HighStateAllRunner)1