From d777757d21c15942275bff6bb98876637950d73f Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Mon, 14 Sep 2015 20:26:56 -0700 Subject: [PATCH] HDFS-9065. Include commas on # of files, blocks, total filesystem objects in NN Web UI. Contributed by Daniel Templeton. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html | 2 +- .../hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js | 3 +++ .../hadoop-hdfs/src/main/webapps/static/dfs-dust.js | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 35dcd8066b..f0bc0268ec 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -912,6 +912,9 @@ Release 2.8.0 - UNRELEASED HDFS-9010. Replace NameNode.DEFAULT_PORT with HdfsClientConfigKeys. DFS_NAMENODE_RPC_PORT_DEFAULT config key. (Mingliang Liu via wheat9) + HDFS-9065. Include commas on # of files, blocks, total filesystem objects + in NN Web UI. (Daniel Templeton via wheat9) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than 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 36f8bfe937..ad3ac0d637 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 @@ -145,7 +145,7 @@

{#fs} - {FilesTotal} files and directories, {BlocksTotal} blocks = {@math key="{FilesTotal}" method="add" operand="{BlocksTotal}"/} total filesystem object(s). + {FilesTotal|fmt_number} files and directories, {BlocksTotal|fmt_number} blocks = {ObjectsTotal|fmt_number} total filesystem object(s). {#helper_fs_max_objects/} {/fs}

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 9bc1b5de0d..cc3afcdc62 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 @@ -103,6 +103,9 @@ b.capacityUsedPercentage = b.capacityUsed * 100.0 / b.capacityTotal; b.capacityRemainingPercentage = b.capacityRemaining * 100.0 / b.capacityTotal; } + + data.fs.ObjectsTotal = data.fs.FilesTotal + data.fs.BlocksTotal; + render(); }), function (url, jqxhr, text, err) { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js index 466e05873d..1f37d21fca 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js @@ -92,6 +92,10 @@ 'helper_to_acl_bit': function (v) { return v ? '+' : ""; + }, + + 'fmt_number': function (v) { + return v.toLocaleString(); } }; $.extend(dust.filters, filters);