use of com.sequenceiq.cloudbreak.orchestrator.yarn.poller.YarnAppBootstrap in project cloudbreak by hortonworks.
the class YarnContainerOrchestrator method runContainer.
@Override
public List<ContainerInfo> runContainer(ContainerConfig config, OrchestrationCredential cred, ContainerConstraint constraint, ExitCriteriaModel exitCriteriaModel) throws CloudbreakOrchestratorException {
// Create an application per component
List<ContainerInfo> containerInfos = new ArrayList<>();
for (int componentNumber = 1; componentNumber <= constraint.getInstances(); componentNumber++) {
try {
submitHandler.submitApplication(config, cred, constraint, componentNumber);
String applicationName = applicationUtils.getApplicationName(constraint, componentNumber);
OrchestratorBootstrap bootstrap = new YarnAppBootstrap(applicationName, cred.getApiEndpoint());
Callable<Boolean> runner = runner(bootstrap, getExitCriteria(), exitCriteriaModel);
Future<Boolean> appFuture = getParallelOrchestratorComponentRunner().submit(runner);
appFuture.get();
containerInfos.add(detailHandler.getContainerInfo(config, cred, constraint, componentNumber));
} catch (CloudbreakOrchestratorException | InterruptedException | ExecutionException e) {
throw new CloudbreakOrchestratorFailedException(e);
}
}
return containerInfos;
}
Aggregations