[ 
https://issues.apache.org/jira/browse/HDFS-5196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931042#comment-13931042
 ] 

Haohui Mai commented on HDFS-5196:
----------------------------------

The patch mostly looks good.

{code}
diff --git 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
index 43952be..cb0bf79 100644
--- 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
+++ 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
@@ -243,6 +243,8 @@ private static void setupServlets(HttpServer2 httpServer, 
Configuration conf) {
         FileChecksumServlets.RedirectServlet.class, false);
     httpServer.addInternalServlet("contentSummary", "/contentSummary/*",
         ContentSummaryServlet.class, false);
+    httpServer.addInternalServlet("snapshot", 
+        SnapshotInfoServlet.PATH_SPEC, SnapshotInfoServlet.class, false);
   }
{code}

It might be more appropriate to put the information in jmx. For example, in 
{{FSNamesystemState}}.

{code}
+  public Object getSnapshottableDirs() throws IOException {
+    //Map<String, Map<String,Object>> info = new HashMap<String, Map<String, 
Object>>();
+    List<Map> info = new ArrayList<Map>();
+    SnapshottableDirectoryStatus[] stats = getSnapshottableDirListing();
+    if (stats == null) {
+      return "{}";
...
{code}

The code should return a {{MXBean}} instead of JSON string. Otherwise it 
requires hacks and workarounds in the client side to parse the JSON. Please see 
HDFS-6013 if you have more questions.

{code}
+        alert(err);

...

-      })).error(ajax_error_handler);
+      }),
+      function (url, jqxhr, text, err) {
+        show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + 
err + '</p>');
+      });
{code}

These changes look unrelated. Can you please remove them from this patch?

> Provide more snapshot information in WebUI
> ------------------------------------------
>
>                 Key: HDFS-5196
>                 URL: https://issues.apache.org/jira/browse/HDFS-5196
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: snapshots
>    Affects Versions: 3.0.0
>            Reporter: Haohui Mai
>            Assignee: Shinichi Yamashita
>            Priority: Minor
>         Attachments: HDFS-5196-2.patch, HDFS-5196.patch, HDFS-5196.patch, 
> HDFS-5196.patch, snapshot-new-webui.png, snapshottable-directoryList.png, 
> snapshotteddir.png
>
>
> The WebUI should provide more detailed information about snapshots, such as 
> all snapshottable directories and corresponding number of snapshots 
> (suggested in HDFS-4096).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to