Search in sources :

Example 1 with SaltUpload

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

the class SaltOrchestrator method uploadFileToGateways.

private void uploadFileToGateways(SaltConnector saltConnector, Set<String> targets, ExitCriteriaModel exitCriteriaModel, String path, String fileName, byte[] content) throws CloudbreakOrchestratorFailedException {
    try {
        OrchestratorBootstrap saltUpload = new SaltUpload(saltConnector, targets, path, fileName, content);
        Callable<Boolean> saltUploadRunner = runner(saltUpload, exitCriteria, exitCriteriaModel);
        Future<Boolean> saltUploadRunnerFuture = parallelOrchestratorComponentRunner.submit(saltUploadRunner);
        saltUploadRunnerFuture.get();
    } catch (Exception e) {
        LOGGER.error("Error occurred during file distribute to gateway nodes", e);
        throw new CloudbreakOrchestratorFailedException(e);
    }
}
Also used : CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) OrchestratorBootstrap(com.sequenceiq.cloudbreak.orchestrator.OrchestratorBootstrap) CloudbreakOrchestratorException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException) CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) SaltUpload(com.sequenceiq.cloudbreak.orchestrator.salt.poller.SaltUpload)

Aggregations

OrchestratorBootstrap (com.sequenceiq.cloudbreak.orchestrator.OrchestratorBootstrap)1 CloudbreakOrchestratorException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException)1 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)1 SaltUpload (com.sequenceiq.cloudbreak.orchestrator.salt.poller.SaltUpload)1 IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1