Github user danny0405 commented on a diff in the pull request: https://github.com/apache/storm/pull/2800#discussion_r212801184 --- Diff: storm-client/src/jvm/org/apache/storm/stats/StatsUtil.java --- @@ -1525,27 +1528,24 @@ public static ComponentPageInfo aggCompExecsStats( * @param timeout timeout * @return a HashMap of updated executor heart beats */ - public static Map<List<Integer>, Map<String, Object>> updateHeartbeatCacheFromZkHeartbeat(Map<List<Integer>, Map<String, Object>> cache, - Map<List<Integer>, Map<String, Object>> - executorBeats, - Set<List<Integer>> executors, - Integer timeout) { - Map<List<Integer>, Map<String, Object>> ret = new HashMap<>(); - if (cache == null && executorBeats == null) { - return ret; - } - + public static ConcurrentMap<List<Integer>, Map<String, Object>> updateHeartbeatCacheFromZkHeartbeat(Map<List<Integer>, Map<String, Object>> cache, + Map<List<Integer>, Map<String, Object>> + executorBeats, + Set<List<Integer>> executors, + Integer timeout) { if (cache == null) { + if (executorBeats == null) { --- End diff -- Concurrently modify a HashMap is ok if we are not also iterate over it, for heartbeats updating, we only need a final consistency.
---