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; }
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; }