use of com.hubspot.singularity.executor.shells.SingularityExecutorShellCommandRunner in project Singularity by HubSpot.
the class SingularityExecutorMesosFrameworkMessageHandler method handleShellRequest.
private void handleShellRequest(SingularityTaskShellCommandRequest shellRequest) {
Optional<SingularityExecutorTask> matchingTask = monitor.getTask(shellRequest.getTaskId().getId());
if (!matchingTask.isPresent()) {
LOG.warn("Missing task for {}, ignoring shell request", shellRequest.getTaskId());
return;
}
matchingTask.get().getLog().info("Received shell request {}", shellRequest);
SingularityExecutorShellCommandUpdater updater = new SingularityExecutorShellCommandUpdater(objectMapper, shellRequest, matchingTask.get());
Optional<SingularityExecutorTaskProcessCallable> taskProcess = monitor.getTaskProcess(shellRequest.getTaskId().getId());
if (!taskProcess.isPresent()) {
updater.sendUpdate(UpdateType.INVALID, Optional.of("No task process found"), Optional.<String>absent());
return;
}
SingularityExecutorShellCommandRunner shellRunner = new SingularityExecutorShellCommandRunner(shellRequest, executorConfiguration, matchingTask.get(), taskProcess.get(), monitor.getShellCommandExecutorServiceForTask(shellRequest.getTaskId().getId()), updater);
shellRunner.start();
}
Aggregations