Ethanlm commented on a change in pull request #3213: [STORM-3588] add
GenericResourceAwareSchedulingPriorityStrategy to accommodate generic resource
in grading topologies
URL: https://github.com/apache/storm/pull/3213#discussion_r406923154
##########
File path:
storm-server/src/main/java/org/apache/storm/scheduler/resource/ResourceAwareScheduler.java
##########
@@ -219,8 +224,14 @@ private void scheduleTopology(TopologyDetails td, Cluster
cluster, final User to
}
}
}
-
- if (!evictedSomething) {
+ if (!tmpEvictedTopos.isEmpty()) {
+ LOG.warn("Evicted Topologies {} when scheduling
topology: {}", tmpEvictedTopos, td.getId());
+ String topoId = td.getId();
+ if (!tmpEvictedTopologiesMap.containsKey(topoId)) {
+ tmpEvictedTopologiesMap.put(topoId, new
HashSet<>());
+ }
+
tmpEvictedTopologiesMap.get(topoId).addAll(tmpEvictedTopos);
Review comment:
Can simplify this with
```
tmpEvictedTopologiesMap.computeIfAbsent(topoId, k -> new
HashSet<>()).addAll(tmpEvictedTopos);
```
----------------------------------------------------------------
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