use of mesos.internal.Messages.RunTaskMessage in project jesos by groupon.
the class LocalExecutorMessageProcessor method runTask.
@Subscribe
public void runTask(final RunTaskMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
if (context.isStateMachine(DRIVER_ABORTED)) {
LOG.warn("driver is aborted!");
return;
}
final RunTaskMessage message = envelope.getMessage();
final TaskInfo task = message.getTask();
checkState(!tasks.containsKey(task.getTaskId()), "Task %s already started!", task.getTaskId().getValue());
tasks.put(task.getTaskId(), task);
eventBus.post(new ExecutorCallback() {
@Override
public Runnable getCallback(final Executor executor, final ExecutorDriver executorDriver) {
return new Runnable() {
@Override
public void run() {
executor.launchTask(executorDriver, task);
}
@Override
public String toString() {
return "callback for launchTask()";
}
};
}
});
}
Aggregations