Exemplo n.º 1
0
 private boolean hostSatisfiesHostAffinity(long hostId, List<Constraint> hostAffinityConstraints) {
   for (Constraint constraint : hostAffinityConstraints) {
     AllocationCandidate candidate = new AllocationCandidate();
     candidate.setHost(hostId);
     if (!constraint.matches(candidate)) {
       return false;
     }
   }
   return true;
 }
Exemplo n.º 2
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;
 }