hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject git commit: HDFS-5928. Show namespace and namenode ID on NN dfshealth page. Contributed by Siqi Li.
Date Mon, 27 Oct 2014 23:24:30 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk a16d022ca -> 00b4e44a2


HDFS-5928. Show namespace and namenode ID on NN dfshealth page. Contributed by Siqi Li.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/00b4e44a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/00b4e44a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/00b4e44a

Branch: refs/heads/trunk
Commit: 00b4e44a2eba871b4ab47e51c52de95b12dca82e
Parents: a16d022
Author: Haohui Mai <wheat9@apache.org>
Authored: Mon Oct 27 16:22:19 2014 -0700
Committer: Haohui Mai <wheat9@apache.org>
Committed: Mon Oct 27 16:22:19 2014 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt        |  3 +++
 .../src/main/webapps/hdfs/dfshealth.html           |  9 +++++++--
 .../hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js | 17 +++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/00b4e44a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 48a1275..9646581 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -309,6 +309,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7283. Bump DataNode OOM log from WARN to ERROR.
     (Stephen Chu via wheat9)
 
+    HDFS-5928. Show namespace and namenode ID on NN dfshealth page.
+    (Siqi Li via wheat9)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/00b4e44a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
index 02858f1..7798cba 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
@@ -116,15 +116,20 @@
 {/nn}
 
 <div class="page-header"><h1>Overview {#nnstat}<small>'{HostAndPort}' ({State})</small>{/nnstat}</h1></div>
-{#nn}
+
 <table class="table table-bordered table-striped">
+{#HAInfo}
+  <tr><th>Namespace:</th><td>{Namespace}</td></tr>
+  <tr><th>Namenode ID:</th><td>{NamenodeID}</td></tr>
+{/HAInfo}
+{#nn}
   <tr><th>Started:</th><td>{NNStarted}</td></tr>
   <tr><th>Version:</th><td>{Version}</td></tr>
   <tr><th>Compiled:</th><td>{CompileInfo}</td></tr>
   <tr><th>Cluster ID:</th><td>{ClusterId}</td></tr>
   <tr><th>Block Pool ID:</th><td>{BlockPoolId}</td></tr>
-</table>
 {/nn}
+</table>
 
 <div class="page-header"><h1>Summary</h1></div>
 <p>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/00b4e44a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
index e63c279..f6dc627 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
@@ -54,6 +54,23 @@
 
     var data = {};
 
+    $.ajax({'url': '/conf', 'dataType': 'xml', 'async': false}).done(
+      function(d) {
+        var $xml = $(d);
+        var namespace, nnId;
+        $xml.find('property').each(function(idx,v) {
+          if ($(v).find('name').text() === 'dfs.nameservice.id') {
+            namespace = $(v).find('value').text();
+          }
+          if ($(v).find('name').text() === 'dfs.ha.namenode.id') {
+            nnId = $(v).find('value').text();
+          }
+        });
+        if (namespace && nnId) {
+          data['HAInfo'] = {"Namespace": namespace, "NamenodeID": nnId};
+        }
+    });
+
     // Workarounds for the fact that JMXJsonServlet returns non-standard JSON strings
     function workaround(nn) {
       nn.JournalTransactionInfo = JSON.parse(nn.JournalTransactionInfo);


Mime
View raw message