public List<OfferRecommendation> evaluate(List<Offer> offers){
  List<OfferRecommendation> recommendations=new ArrayList<OfferRecommendation>();
  int offerResourceCount=0;
  for (  Offer offer : offers) {
    offerResourceCount+=offer.getResourcesCount();
    for (    Resource toDestroy : selectUnexpectedResources(expectedPersistentVolumeIds,getPersistentVolumesById(offer))) {
      recommendations.add(new DestroyOfferRecommendation(offer,toDestroy));
    }
  }
  int destroyRecommendationCount=recommendations.size();
  for (  Offer offer : offers) {
    for (    Resource toUnreserve : selectUnexpectedResources(expectedReservedResourceIds,getReservedResourcesById(offer))) {
      recommendations.add(new UnreserveOfferRecommendation(offer,toUnreserve));
    }
  }
  logger.info("{} offers with {} resources => {} destroy and {} unreserve operations",offers.size(),offerResourceCount,destroyRecommendationCount,recommendations.size() - destroyRecommendationCount);
  return recommendations;
}

public List < OfferRecommendation > evaluate ( List < Offer > offers ) { List < OfferRecommendation > recommendations = new ArrayList < OfferRecommendation > ( ) ; int offerResourceCount = 0 ; for ( Offer offer : offers ) { offerResourceCount += offer . getResourcesCount ( ) ; for ( Resource toDestroy : selectUnexpectedResources ( expectedPersistentVolumeIds , getPersistentVolumesById ( offer ) ) ) { recommendations . add ( new DestroyOfferRecommendation ( offer , toDestroy ) ) ; } } int destroyRecommendationCount = recommendations . size ( ) ; for ( Offer offer : offers ) { for ( Resource toUnreserve : selectUnexpectedResources ( expectedReservedResourceIds , getReservedResourcesById ( offer ) ) ) { recommendations . add ( new UnreserveOfferRecommendation ( offer , toUnreserve ) ) ; } } logger . info ( "{} offers with {} resources => {} destroy and {} unreserve operations" , offers . size ( ) , offerResourceCount , destroyRecommendationCount , recommendations . size ( ) - destroyRecommendationCount ) ; return recommendations ; }
returns a list of operations which should be performed , given the provided list of offers from mesos . the returned operations must be performed in the order in which they are provided .
