huangzhaobo99 commented on code in PR #5597:
URL: https://github.com/apache/hadoop/pull/5597#discussion_r1582490565


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:
##########
@@ -2630,6 +2631,28 @@ public int getActiveTransferThreadCount() {
 
   @Override // DataNodeMXBean
   public Map<String, Map<String, Long>> getDatanodeNetworkCounts() {
+    int maxDisplay = 
getConf().getInt(DFSConfigKeys.DFS_DATANODE_NETWORKERRORS_DISPLAY_TOPCOUNT,
+        DFSConfigKeys.DFS_DATANODE_NETWORKERRORS_DISPLAY_TOPCOUNT_DEFAULT);
+    if (maxDisplay >= 0) {

Review Comment:
   Can we first determine the size of the map? If it is less than N, we can 
return it directly.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to