Ethanlm commented on a change in pull request #3215: Storm3585 - New compact
Constraint config including maxNodeCoLocationCnt and incompatibleComponents
URL: https://github.com/apache/storm/pull/3215#discussion_r388510854
##########
File path:
storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/ConstraintSolverStrategy.java
##########
@@ -447,22 +552,24 @@ public boolean isExecAssignmentToWorkerValid(WorkerSlot
worker, SearcherState st
return retMap;
}
- private ArrayList<ExecutorDetails> getSortedExecs(HashSet<String>
spreadComps, Map<String, Map<String, Integer>> constraintMatrix,
+ private ArrayList<ExecutorDetails> getSortedExecs(Map<String, Integer>
spreadCompCnts,
+ Map<String, Set<String>>
constraintMatrix,
Map<String,
Set<ExecutorDetails>> compToExecs) {
ArrayList<ExecutorDetails> retList = new ArrayList<>();
//find number of constraints per component
//Key->Comp Value-># of constraints
- Map<String, Integer> compConstraintCountMap = new HashMap<>();
+ Map<String, Double> compConstraintCountMap = new HashMap<>();
constraintMatrix.forEach((comp, subMatrix) -> {
- int count =
subMatrix.values().stream().mapToInt(Number::intValue).sum();
- //check component is declared for spreading
- if (spreadComps.contains(comp)) {
- count++;
+ double count = subMatrix.size();
+ // check if component is declared for spreading
+ if (spreadCompCnts.containsKey(comp)) {
+ // lower (1 and above only) value is most constrained should
have higher count
Review comment:
typo: `most` -> `more`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services