From edd5373095bb5b063fe90c984dd62a15b1ee95ba Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Fri, 17 Jun 2016 11:13:12 -0500 Subject: [PATCH] HDFS-10493. Add links to datanode web UI in namenode datanodes page. Contributed by Weiwei Yang. (cherry picked from commit 280069510b71d81a150b2b28d9fa987891d82774) --- .../hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html | 9 +++++++++ .../hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js | 10 ++++++++++ 2 files changed, 19 insertions(+) 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 66c0dec1e51..4fa2e4c02d1 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 @@ -300,6 +300,7 @@ Node + Http Address Last contact Capacity Blocks @@ -310,6 +311,13 @@ {#LiveNodes} {name} ({xferaddr}) + + {@select key=secureMode} + {@eq value="off"}{infoAddr}{/eq} + {@eq value="on"}{infoSecureAddr}{/eq} + {@default}{infoAddr}{/default} + {/select} + {lastContact}s
@@ -328,6 +336,7 @@ {#DeadNodes} {name} ({xferaddr}) + {#helper_relative_time value="{lastContact}"/} 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 e7245dfbfb8..e2908c02b50 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 @@ -210,6 +210,15 @@ for (var i = 0, e = nodes.length; i < e; ++i) { var n = nodes[i]; n.usedPercentage = Math.round((n.used + n.nonDfsUsedSpace) * 1.0 / n.capacity * 100); + + var addr = n.infoSecureAddr; + var position = addr.lastIndexOf(":"); + var port = addr.substring(position + 1, addr.length); + n.secureMode = "off"; + if (port != 0) { + n.secureMode = "on"; + } + if (n.adminState === "In Service") { n.state = "alive"; } else if (nodes[i].adminState === "Decommission In Progress") { @@ -248,6 +257,7 @@ $('#table-datanodes').dataTable( { 'lengthMenu': [ [25, 50, 100, -1], [25, 50, 100, "All"] ], 'columns': [ + { 'orderDataType': 'ng-value', 'searchable': true }, { 'orderDataType': 'ng-value', 'searchable': true }, { 'orderDataType': 'ng-value', 'type': 'numeric' }, { 'orderDataType': 'ng-value', 'type': 'numeric' },