hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jia...@apache.org
Subject [28/44] hadoop git commit: HDFS-7483. Display information per tier on the Namenode UI. Contributed by Benoy Antony and Haohui Mai.
Date Tue, 21 Jul 2015 23:14:12 GMT
HDFS-7483. Display information per tier on the Namenode UI. Contributed by Benoy Antony and
Haohui Mai.


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

Branch: refs/heads/YARN-1197
Commit: df1e8ce44a4716b2cb4ff3d161d7df8081572290
Parents: a628f67
Author: Haohui Mai <wheat9@apache.org>
Authored: Mon Jul 20 20:10:53 2015 -0700
Committer: Haohui Mai <wheat9@apache.org>
Committed: Mon Jul 20 20:13:12 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt     |  3 +++
 .../src/main/webapps/hdfs/dfshealth.html        | 25 ++++++++++++++++++++
 .../src/main/webapps/hdfs/dfshealth.js          |  8 +++++++
 .../blockmanagement/TestBlockStatsMXBean.java   |  1 -
 4 files changed, 36 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/df1e8ce4/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 1293388..f38a870 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -729,6 +729,9 @@ Release 2.8.0 - UNRELEASED
 
     HDFS-8794. Improve CorruptReplicasMap#corruptReplicasMap. (yliu)
 
+    HDFS-7483. Display information per tier on the Namenode UI.
+    (Benoy Antony and wheat9 via wheat9)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/df1e8ce4/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 5a3a309..8cdff84 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
@@ -199,6 +199,31 @@
   {#failed}{#helper_dir_status type="Failed"/}{/failed}
   {/nn.NameDirStatuses}
 </table>
+<div class="page-header"><h1>DFS Storage Types</h1></div>
+<small>
+<table class="table">
+  <thead>
+    <tr>
+      <th>Storage Type</th>
+      <th>Configured Capacity</th>
+      <th>Capacity Used</th>
+      <th>Capacity Remaining</th>
+      <th>Block Pool Used</th>
+      <th>Nodes In Service</th>
+    </tr>
+  </thead>
+  {#blockstats.StorageTypeStats}
+  <tr>
+    <td>{key}</td>
+    <td>{value.capacityTotal|fmt_bytes}</td>
+    <td>{value.capacityUsed|fmt_bytes} ({value.capacityUsedPercentage|fmt_percentage})</td>
+    <td>{value.capacityRemaining|fmt_bytes} ({value.capacityRemainingPercentage|fmt_percentage})</td>
+    <td>{value.blockPoolUsed|fmt_bytes}</td>
+    <td>{value.nodesInService}</td>
+  </tr>
+  {/blockstats.StorageTypeStats}
+</table>
+</small>
 </script>
 
 <script type="text/x-dust-template" id="tmpl-snapshot">

http://git-wip-us.apache.org/repos/asf/hadoop/blob/df1e8ce4/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 a045e42..1c13493 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
@@ -29,6 +29,7 @@
       {"name": "nn",      "url": "/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo"},
       {"name": "nnstat",  "url": "/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus"},
       {"name": "fs",      "url": "/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState"},
+      {"name": "blockstats",      "url": "/jmx?qry=Hadoop:service=NameNode,name=BlockStats"},
       {"name": "mem",     "url": "/jmx?qry=java.lang:type=Memory"}
     ];
 
@@ -88,6 +89,13 @@
         for (var k in d) {
           data[k] = k === 'nn' ? workaround(d[k].beans[0]) : d[k].beans[0];
         }
+
+        var blockstats = data['blockstats'];
+        for (var k in blockstats.StorageTypeStats) {
+          var b = blockstats.StorageTypeStats[k].value;
+          b.capacityUsedPercentage = b.capacityUsed * 100.0 / b.capacityTotal;
+          b.capacityRemainingPercentage = b.capacityRemaining * 100.0 / b.capacityTotal;
+        }
         render();
       }),
       function (url, jqxhr, text, err) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/df1e8ce4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockStatsMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockStatsMXBean.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockStatsMXBean.java
index 43d983d..2fe8768 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockStatsMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockStatsMXBean.java
@@ -106,7 +106,6 @@ public class TestBlockStatsMXBean {
   public void testStorageTypeStatsJMX() throws Exception {
     URL baseUrl = new URL (cluster.getHttpUri(0));
     String result = readOutput(new URL(baseUrl, "/jmx"));
-    System.out.println(result);
 
     Map<String, Object> stat = (Map<String, Object>) JSON.parse(result);
     Object[] beans =(Object[]) stat.get("beans");


Mime
View raw message