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

Haohui Mai commented on HDFS-7424:
----------------------------------

Good work. Some comments:

{code}
+/**
+ * Encapsulates the HTTP server started by the NFS3 gateway.
+ */
+@InterfaceAudience.Private
+public class Nfs3HttpServer {
{code}

You can simply mark the class as package-local.

{code}
+  void start() throws IOException {
+    HttpServer2.Builder builder = new HttpServer2.Builder().setName("nfs3")
+        .setConf(conf).setACL(new AccessControlList(conf.get(DFS_ADMIN, " ")));
{code}

Please see {{DFSUtil.httpServerTemplateForNNAndJN}}.

{code}
+  public int getSecurePort() {
+    return this.infoSecurePort;
+  }
+
{code}

This is unused.

{code}
+      URL url = new URL(scheme + "://" + NetUtils.getHostPortString(addr)
+          + "/jmx");
+      URLConnection conn = connectionFactory.openConnection(url);
+      conn.connect();
+
+      InputStream is = conn.getInputStream();
+      InputStreamReader isr = new InputStreamReader(is);
+
+      int numCharsRead;
+      char[] charArray = new char[1024];
+      StringBuffer sb = new StringBuffer();
+      while ((numCharsRead = isr.read(charArray)) > 0) {
+        sb.append(charArray, 0, numCharsRead);
+      }
+      result = sb.toString();
+
+    } catch (Exception e) {
+      e.printStackTrace();
+      return null;
+    }
+    return result;
{code}

See {{DFSTestUtil.urlGet()}}.

> Add web UI for NFS gateway
> --------------------------
>
>                 Key: HDFS-7424
>                 URL: https://issues.apache.org/jira/browse/HDFS-7424
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: nfs
>    Affects Versions: 2.2.0
>            Reporter: Brandon Li
>            Assignee: Brandon Li
>         Attachments: HDFS-7424.001.patch, HDFS-7424.002.patch
>
>
> This JIRA is to track the effort to add web UI for NFS gateway to show some 
> metrics and configuration related information.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to