use of mesos.internal.Messages.LostSlaveMessage in project jesos by groupon.
the class LocalSchedulerMessageProcessor method frameworkLostSlave.
@Subscribe
public void frameworkLostSlave(final LostSlaveMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
final UPID sender = envelope.getSender();
if (!driverIsConnected(sender)) {
return;
}
final LostSlaveMessage lostSlaveMessage = envelope.getMessage();
final SlaveID slaveId = lostSlaveMessage.getSlaveId();
context.removeSlave(slaveId);
eventBus.post(new SchedulerCallback() {
@Override
public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
return new Runnable() {
@Override
public void run() {
scheduler.slaveLost(schedulerDriver, slaveId);
}
};
}
});
}
Aggregations