Github user kishorvpatil commented on a diff in the pull request:
https://github.com/apache/storm/pull/2700#discussion_r192811084
--- Diff:
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
@@ -1333,6 +1336,21 @@ private AssignmentDistributionService
getAssignmentsDistributer() {
return heartbeatsCache;
}
+ public AtomicReference<Map<String, Set<List<Integer>>>>
getIdToExecutors() {
+ return idToExecutors;
+ }
+
+ private Set<List<Integer>> getOrUpdateExecutors(String topoId,
StormBase base, Map<String, Object> topoConf,
+ StormTopology topology)
+ throws IOException, AuthorizationException,
InvalidTopologyException, KeyNotFoundException {
+ Set<List<Integer>> executors = idToExecutors.get().get(topoId);
+ if (null == executors) {
+ executors = new HashSet<>(computeExecutors(topoId, base,
topoConf, topology));
+ idToExecutors.getAndUpdate(new Assoc<>(topoId, executors));
--- End diff --
Do we intend to create new HashMap every time? If not, would
`idToExecutors.get().put(topoId, executors);` should suffice?
---