Search in sources :

Example 1 with SlaveID

use of org.apache.mesos.Protos.SlaveID 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);
                }
            };
        }
    });
}
Also used : UPID(com.groupon.mesos.util.UPID) Scheduler(org.apache.mesos.Scheduler) LostSlaveMessage(mesos.internal.Messages.LostSlaveMessage) SlaveID(org.apache.mesos.Protos.SlaveID) SchedulerDriver(org.apache.mesos.SchedulerDriver) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)1 UPID (com.groupon.mesos.util.UPID)1 LostSlaveMessage (mesos.internal.Messages.LostSlaveMessage)1 SlaveID (org.apache.mesos.Protos.SlaveID)1 Scheduler (org.apache.mesos.Scheduler)1 SchedulerDriver (org.apache.mesos.SchedulerDriver)1