use of com.sequenceiq.cloudbreak.orchestrator.salt.poller.BaseSaltJobRunner in project cloudbreak by hortonworks.
the class SaltOrchestrator method resetAmbari.
@Override
public void resetAmbari(GatewayConfig gatewayConfig, Set<String> target, Set<Node> allNodes, ExitCriteriaModel exitCriteriaModel) throws CloudbreakOrchestratorException {
try (SaltConnector saltConnector = new SaltConnector(gatewayConfig, restDebug)) {
BaseSaltJobRunner baseSaltJobRunner = new BaseSaltJobRunner(target, allNodes) {
@Override
public String submit(SaltConnector saltConnector) {
return SaltStates.ambariReset(saltConnector, new Compound(getTarget(), CompoundType.HOST));
}
};
OrchestratorBootstrap saltJobIdTracker = new SaltJobIdTracker(saltConnector, baseSaltJobRunner);
Callable<Boolean> saltJobRunBootstrapRunner = runner(saltJobIdTracker, exitCriteria, exitCriteriaModel);
Future<Boolean> saltJobRunBootstrapFuture = parallelOrchestratorComponentRunner.submit(saltJobRunBootstrapRunner);
saltJobRunBootstrapFuture.get();
} catch (Exception e) {
LOGGER.error("Error occurred during reset", e);
throw new CloudbreakOrchestratorFailedException(e);
}
}
Aggregations