use of mesos.internal.Messages.RescindResourceOfferMessage in project jesos by groupon.
the class LocalSchedulerMessageProcessor method frameworkRescindOffer.
@Subscribe
public void frameworkRescindOffer(final RescindResourceOfferMessageEnvelope envelope) {
checkState(envelope.getRecipient().equals(context.getDriverUPID()), "Received a remote message for local delivery");
final UPID sender = envelope.getSender();
if (!driverIsConnected(sender)) {
return;
}
final RescindResourceOfferMessage rescindResourceOfferMessage = envelope.getMessage();
context.removeAllOffers(rescindResourceOfferMessage.getOfferId());
eventBus.post(new SchedulerCallback() {
@Override
public Runnable getCallback(final Scheduler scheduler, final SchedulerDriver schedulerDriver) {
return new Runnable() {
@Override
public void run() {
scheduler.offerRescinded(schedulerDriver, rescindResourceOfferMessage.getOfferId());
}
};
}
});
}
Aggregations