use of mesos.internal.Messages.KillTaskMessage in project jesos by groupon.
the class LocalExecutorMessageProcessor method killTask.
@Subscribe
public void killTask(final KillTaskMessageEnvelope 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 KillTaskMessage message = envelope.getMessage();
eventBus.post(new ExecutorCallback() {
@Override
public Runnable getCallback(final Executor executor, final ExecutorDriver executorDriver) {
return new Runnable() {
@Override
public void run() {
executor.killTask(executorDriver, message.getTaskId());
}
@Override
public String toString() {
return "callback for killTask()";
}
};
}
});
}
use of mesos.internal.Messages.KillTaskMessage in project jesos by groupon.
the class InternalSchedulerDriver method killTask.
@Override
public Status killTask(final TaskID taskId) {
checkNotNull(taskId, "taskId is null");
if (!context.isStateMachine(DRIVER_RUNNING)) {
return context.getStateMachine();
}
final KillTaskMessage message = KillTaskMessage.newBuilder().setFrameworkId(context.getFrameworkId()).setTaskId(taskId).build();
eventBus.post(new RemoteMessageEnvelope(context.getDriverUPID(), context.getMasterUPID(), message));
return context.getStateMachine();
}
Aggregations