public class OfferUtils
extends java.lang.Object
| Constructor and Description |
|---|
OfferUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
declineLong(SchedulerDriver driver,
java.util.Collection<Protos.Offer> unusedOffers) |
static void |
declineShort(SchedulerDriver driver,
java.util.Collection<Protos.Offer> unusedOffers) |
static java.util.List<Protos.Offer> |
filterOutAcceptedOffers(java.util.List<Protos.Offer> offers,
java.util.Collection<Protos.OfferID> acceptedOfferIds)
Filters out accepted offers and returns back a list of unused offers.
|
static boolean |
isOfferAccepted(Protos.Offer offer,
java.util.Collection<Protos.OfferID> acceptedOfferIds)
Determines if a certain offer is part of the accepted OfferID collection.
|
public static java.util.List<Protos.Offer> filterOutAcceptedOffers(java.util.List<Protos.Offer> offers,
java.util.Collection<Protos.OfferID> acceptedOfferIds)
offers - An org.apache.mesos.Protos.Offer collection containing both ACCEPTED and
UNACCEPTED offers.acceptedOfferIds - A collection of OfferIDs that are already ACCEPTED.public static boolean isOfferAccepted(Protos.Offer offer,
java.util.Collection<Protos.OfferID> acceptedOfferIds)
offer - An org.apache.mesos.Protos.Offer that needs to be checked for acceptance.acceptedOfferIds - A Collection of accepted org.apache.mesos.Protos.OfferID.true if org.apache.mesos.Protos.Offer is accepted; false otherwise.public static void declineShort(SchedulerDriver driver,
java.util.Collection<Protos.Offer> unusedOffers)
public static void declineLong(SchedulerDriver driver,
java.util.Collection<Protos.Offer> unusedOffers)