use of mesos.internal.Messages.ExecutorToFrameworkMessage in project jesos by groupon.
the class LocalSchedulerMessageProcessor method frameworkFrameworkMessage.
@Subscribe
public void frameworkFrameworkMessage(final ExecutorToFrameworkMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
final UPID sender = envelope.getSender();
if (!driverIsConnected(sender)) {
return;
}
final ExecutorToFrameworkMessage executorToFrameworkMessage = envelope.getMessage();
eventBus.post(new SchedulerCallback() {
@Override
public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
return new Runnable() {
@Override
public void run() {
scheduler.frameworkMessage(schedulerDriver, executorToFrameworkMessage.getExecutorId(), executorToFrameworkMessage.getSlaveId(), executorToFrameworkMessage.getData().toByteArray());
}
};
}
});
}
use of mesos.internal.Messages.ExecutorToFrameworkMessage in project jesos by groupon.
the class InternalExecutorDriver method sendFrameworkMessage.
@Override
public Status sendFrameworkMessage(final byte[] data) {
checkNotNull(data, "data is null");
if (!context.isStateMachine(DRIVER_RUNNING)) {
return context.getStateMachine();
}
final ExecutorToFrameworkMessage message = ExecutorToFrameworkMessage.newBuilder().setSlaveId(context.getSlaveId()).setFrameworkId(context.getFrameworkId()).setExecutorId(context.getExecutorId()).setData(ByteString.copyFrom(data)).build();
eventBus.post(new RemoteMessageEnvelope(context.getDriverUPID(), context.getSlaveUPID(), message));
return context.getStateMachine();
}
Aggregations