Search in sources :

Example 1 with FrameworkErrorMessage

use of mesos.internal.Messages.FrameworkErrorMessage in project jesos by groupon.

the class LocalSchedulerMessageProcessor method frameworkError.

@Subscribe
public void frameworkError(final FrameworkErrorMessageEnvelope envelope) {
    checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
    final UPID sender = envelope.getSender();
    if (!driverIsConnected(sender)) {
        return;
    }
    final FrameworkErrorMessage frameworkErrorMessage = envelope.getMessage();
    eventBus.post(new SchedulerCallback() {

        @Override
        public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
            return new Runnable() {

                @Override
                public void run() {
                    schedulerDriver.abort();
                    scheduler.error(schedulerDriver, frameworkErrorMessage.getMessage());
                }
            };
        }
    });
}
Also used : UPID(com.groupon.mesos.util.UPID) Scheduler(org.apache.mesos.Scheduler) FrameworkErrorMessage(mesos.internal.Messages.FrameworkErrorMessage) 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 FrameworkErrorMessage (mesos.internal.Messages.FrameworkErrorMessage)1 Scheduler (org.apache.mesos.Scheduler)1 SchedulerDriver (org.apache.mesos.SchedulerDriver)1