コード例 #1
0
ファイル: AllocatorServiceImpl.java プロジェクト: kalw/cattle
 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;
 }
コード例 #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;
 }