skoppu22 commented on a change in pull request #1428:
URL: https://github.com/apache/cassandra/pull/1428#discussion_r798567367



##########
File path: src/java/org/apache/cassandra/gms/Gossiper.java
##########
@@ -501,6 +563,24 @@ public long getEndpointDowntime(InetAddressAndPort ep)
             return 0L;
     }
 
+    /**
+     * @return a list of the most recent gossip state transitions for all peers
+     */
+    public List<GossipStateTransition> recentGossipStateTransitions()
+    {
+        // flatten the gossipStateTransitions map into a list sorted by the 
timestamp
+        return gossipStateTransitionMap.values().stream()

Review comment:
       Thinking loud. As you mentioned this map size can be up to tens of 
megabytes, preparing a List from this can further pressure the memory with more 
megabytes. So instead of creating a list here, if we just return reference to 
the map and let the caller directly read the map and fill the vtable, can 
reduce memory footprint. What do you think?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to