[ 
https://issues.apache.org/jira/browse/HDFS-16581?focusedWorklogId=780585&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-780585
 ]

ASF GitHub Bot logged work on HDFS-16581:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Jun/22 06:56
            Start Date: 12/Jun/22 06:56
    Worklog Time Spent: 10m 
      Work Description: jianghuazhu commented on code in PR #4321:
URL: https://github.com/apache/hadoop/pull/4321#discussion_r895119994


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java:
##########
@@ -1648,40 +1647,46 @@ public int metaSave(String[] argv, int idx) throws 
IOException {
    * @throws IOException If an error while getting datanode report
    */
   public int printTopology() throws IOException {
-      DistributedFileSystem dfs = getDFS();
-      final DatanodeInfo[] report = dfs.getDataNodeStats();
-
-      // Build a map of rack -> nodes from the datanode report
-      HashMap<String, TreeSet<String> > tree = new HashMap<String, 
TreeSet<String>>();
-      for(DatanodeInfo dni : report) {
-        String location = dni.getNetworkLocation();
-        String name = dni.getName();
-        
-        if(!tree.containsKey(location)) {
-          tree.put(location, new TreeSet<String>());
-        }
+    DistributedFileSystem dfs = getDFS();
+    final DatanodeInfo[] report = dfs.getDataNodeStats();
+
+    // Build a map of rack -> nodes from the datanode report
+    HashMap<String, HashMap<String, String>> tree = new HashMap<String,
+        HashMap<String, String>>();

Review Comment:
   Sorry, this is my mistake, I will update later.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 780585)
    Time Spent: 2h  (was: 1h 50m)

> Print node status when executing printTopology
> ----------------------------------------------
>
>                 Key: HDFS-16581
>                 URL: https://issues.apache.org/jira/browse/HDFS-16581
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: dfsadmin, namenode
>    Affects Versions: 3.3.0
>            Reporter: JiangHua Zhu
>            Assignee: JiangHua Zhu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> We can use the dfsadmin tool to see which DataNodes the cluster has, and some 
> of these nodes are alive, DECOMMISSIONED, or DECOMMISSION_INPROGRESS. It 
> would be helpful if we could get this information in a timely manner, such as 
> troubleshooting cluster failures, tracking node status, etc.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to