Github user zd-project commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2800#discussion_r212801069
  
    --- 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 --
    
    The very same map created here will be used in `updateHeartbeatCache`, 
which may be modified concurrently there. Hope this answered your question.


---

Reply via email to