Java Code Examples for org.apache.mesos.v1.Protos#Filters

The following examples show how to use org.apache.mesos.v1.Protos#Filters . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchedulerDriverService.java    From attic-aurora with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptOffers(
    Protos.OfferID offerId,
    Collection<Protos.Offer.Operation> operations,
    Protos.Filters filter) {
  ensureRunning();

  OfferID convertedOfferId = ProtosConversion.convert(offerId);
  Collection<Operation> convertedOperations =
      Collections2.transform(operations, ProtosConversion::convert);
  Filters convertedFilter = ProtosConversion.convert(filter);

  Futures.getUnchecked(driverFuture)
      .acceptOffers(ImmutableList.of(convertedOfferId), convertedOperations, convertedFilter);
}
 
Example 2
Source File: SchedulerDriverService.java    From attic-aurora with Apache License 2.0 5 votes vote down vote up
@Override
public void declineOffer(Protos.OfferID offerId, Protos.Filters filter) {
  ensureRunning();

  OfferID convertedOfferId = ProtosConversion.convert(offerId);
  Filters convertedFilter = ProtosConversion.convert(filter);

  Futures.getUnchecked(driverFuture).declineOffer(convertedOfferId, convertedFilter);
}
 
Example 3
Source File: ProtosConversion.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
public static org.apache.mesos.Protos.Filters convert(Protos.Filters f) {
  return convert(f, org.apache.mesos.Protos.Filters.newBuilder());
}
 
Example 4
Source File: SchedulerDriverService.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
@Override
public void acceptInverseOffer(Protos.OfferID offerID, Protos.Filters filter) {
  throw new UnsupportedOperationException("SchedulerDriver does not support inverse offers");
}
 
Example 5
Source File: OfferManagerImpl.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
private Protos.Filters getOfferFilter() {
  return Protos.Filters.newBuilder()
      .setRefuseSeconds(offerSettings.getFilterDuration().as(Time.SECONDS))
      .build();
}
 
Example 6
Source File: FakeDriver.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
@Override
public void acceptOffers(Protos.OfferID offerId, Collection<Protos.Offer.Operation> operations,
    Protos.Filters filter) {
  // no-op
}
 
Example 7
Source File: FakeDriver.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
@Override
public void acceptInverseOffer(Protos.OfferID offerID, Protos.Filters filter) {
  // no-op
}
 
Example 8
Source File: FakeDriver.java    From attic-aurora with Apache License 2.0 4 votes vote down vote up
@Override
public void declineOffer(Protos.OfferID offerId, Protos.Filters filters) {
  // no-op
}