use of org.apache.mesos.SchedulerDriver in project jesos by groupon.
the class LocalSchedulerMessageProcessor method frameworkRegistered.
@Subscribe
public void frameworkRegistered(final FrameworkRegisteredMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
final FrameworkRegisteredMessage frameworkRegisteredMessage = envelope.getMessage();
if (!masterIsValid(frameworkRegisteredMessage.getMasterInfo())) {
return;
}
final FrameworkID frameworkId = frameworkRegisteredMessage.getFrameworkId();
context.connected();
context.setFailover(false);
context.setFrameworkId(frameworkId);
eventBus.post(new SchedulerCallback() {
@Override
public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
return new Runnable() {
@Override
public void run() {
scheduler.registered(schedulerDriver, frameworkId, context.getMaster());
}
};
}
});
}
Aggregations