use of mesos.internal.Messages.FrameworkReregisteredMessage in project jesos by groupon.
the class LocalSchedulerMessageProcessor method frameworkReregistered.
@Subscribe
public void frameworkReregistered(final FrameworkReregisteredMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
final FrameworkReregisteredMessage frameworkReregisteredMessage = envelope.getMessage();
if (!masterIsValid(frameworkReregisteredMessage.getMasterInfo())) {
return;
}
final FrameworkID frameworkId = frameworkReregisteredMessage.getFrameworkId();
checkState(frameworkId != null, "Received null framework reregistration message!");
checkState(frameworkId.equals(context.getFrameworkId()), "Received framework reregistration for %s but expected %s", frameworkId.getValue(), context.getFrameworkId().getValue());
context.connected();
context.setFailover(false);
eventBus.post(new SchedulerCallback() {
@Override
public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
return new Runnable() {
@Override
public void run() {
scheduler.reregistered(schedulerDriver, context.getMaster());
}
};
}
});
}
Aggregations