Пример #1
0
 private boolean hostSatisfiesHostAffinity(long hostId, List<Constraint> hostAffinityConstraints) {
   for (Constraint constraint : hostAffinityConstraints) {
     AllocationCandidate candidate = new AllocationCandidate();
     Set<Long> hostIds = new HashSet<Long>();
     hostIds.add(hostId);
     candidate.setHosts(hostIds);
     if (!constraint.matches(null, candidate)) {
       return false;
     }
   }
   return true;
 }