From c131ae39fcc704707e432824b548d1243861c446 Mon Sep 17 00:00:00 2001 From: Jing Zhao Date: Wed, 20 Nov 2013 18:17:41 +0000 Subject: [PATCH] HDFS-5525. Inline dust templates for new Web UI. Contributed by Haohui Mai. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1543895 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 + hadoop-hdfs-project/hadoop-hdfs/pom.xml | 3 - .../src/main/webapps/hdfs/dfs-dust.js | 27 -- .../src/main/webapps/hdfs/dfshealth.dust.html | 265 ----------------- .../src/main/webapps/hdfs/dfshealth.html | 269 ++++++++++++++++++ .../src/main/webapps/hdfs/dfshealth.js | 11 +- .../hdfs/explorer-block-info.dust.html | 13 - .../src/main/webapps/hdfs/explorer.dust.html | 26 -- .../src/main/webapps/hdfs/explorer.html | 51 +++- .../src/main/webapps/hdfs/explorer.js | 16 +- .../src/main/webapps/static/hadoop.css | 5 + 11 files changed, 332 insertions(+), 356 deletions(-) delete mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.dust.html delete mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer-block-info.dust.html delete mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.dust.html diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a352eb124a0..eccf341d7f6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -202,6 +202,8 @@ Trunk (Unreleased) HDFS-5511. improve CacheManipulator interface to allow better unit testing (cmccabe) + HDFS-5525. Inline dust templates for new Web UI. (Haohui Mai via jing9) + OPTIMIZATIONS HDFS-5349. DNA_CACHE and DNA_UNCACHE should be by blockId only. (cmccabe) diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index 3c92933c01b..0b1e55d46c5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -551,9 +551,6 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> src/main/webapps/static/dust-full-2.0.0.min.js src/main/webapps/static/dust-helpers-1.1.1.min.js src/main/webapps/static/jquery-1.10.2.min.js - src/main/webapps/hdfs/dfshealth.dust.html - src/main/webapps/hdfs/explorer-block-info.dust.html - src/main/webapps/hdfs/explorer.dust.html diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfs-dust.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfs-dust.js index b9febf24fae..e2918362db4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfs-dust.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfs-dust.js @@ -59,32 +59,6 @@ }; $.extend(dust.filters, filters); - /** - * Load templates from external sources in sequential orders, and - * compile them. The loading order is important to resolve dependency. - * - * The code compile the templates on the client sides, which should be - * precompiled once we introduce the infrastructure in the building - * system. - * - * templates is an array of tuples in the format of {url, name}. - */ - function load_templates(dust, templates, success_cb, error_cb) { - if (templates.length === 0) { - success_cb(); - return; - } - - var t = templates.shift(); - $.get(t.url, function (tmpl) { - var c = dust.compile(tmpl, t.name); - dust.loadSource(c); - load_templates(dust, templates, success_cb, error_cb); - }).error(function (jqxhr, text, err) { - error_cb(t.url, jqxhr, text, err); - }); - } - /** * Load a sequence of JSON. * @@ -110,7 +84,6 @@ }); } - exports.load_templates = load_templates; exports.load_json = load_json; }($, dust, window)); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.dust.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.dust.html deleted file mode 100644 index e7bb5a2b123..00000000000 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.dust.html +++ /dev/null @@ -1,265 +0,0 @@ - - -{#nn} -{@if cond="{DistinctVersionCount} > 1"} -
- - - There are {DistinctVersionCount} versions of datanodes currently live: - {#DistinctVersions} - {key} ({value}) {@sep},{/sep} - {/DistinctVersions} -
-{/if} - -{@if cond="{NumberOfMissingBlocks} > 0"} -
- - -

There are {NumberOfMissingBlocks} missing blocks. The following files may be corrupted:

-
-
- {#CorruptFiles} - {.}
- {/CorruptFiles} -
-

Please check the logs or run fsck in order to identify the missing blocks. See the Hadoop FAQ for common causes and potential solutions.

-
-{/if} -{/nn} - -
-
Overview
-
- {#nn} - - - - - - -
Started:{NNStarted}
Version:{Version}
Compiled:{CompileInfo}
Cluster ID:{ClusterId}
Block Pool ID:{BlockPoolId}
- {/nn} -
-
- -Browse the filesystem NameNode Logs - -
- -
-
Cluster Summary
-
- -

- Security is {#nnstat}{#SecurityEnabled}on{:else}off{/SecurityEnabled}{/nnstat}.

-

{#nn}{#Safemode}{.}{:else}Safemode is off.{/Safemode}{/nn}

- -

- {#fs} - {TotalLoad} files and directories, {BlocksTotal} blocks = {FilesTotal} total filesystem object(s). - {#helper_fs_max_objects/} - {/fs} -

- {#mem.HeapMemoryUsage} -

Heap Memory used {used|fmt_bytes} of {committed|fmt_bytes} Heap Memory. Max Heap Memory is {max|fmt_bytes}.

- {/mem.HeapMemoryUsage} - - {#mem.NonHeapMemoryUsage} -

Non Heap Memory used {used|fmt_bytes} of {committed|fmt_bytes} Commited Non Heap Memory. Max Non Heap Memory is {max|fmt_bytes}.

- {/mem.NonHeapMemoryUsage} - - {#nn} - - - - - - - - - - - - {/nn} - - {#fs} - - - - - {/fs} -
Configured Capacity:{Total|fmt_bytes}
DFS Used:{Used|fmt_bytes}
Non DFS Used:{NonDfsUsedSpace|fmt_bytes}
DFS Remaining:{Free|fmt_bytes}
DFS Used%:{PercentUsed|fmt_percentage}
DFS Remaining%:{PercentRemaining|fmt_percentage}
Block Pool Used:{BlockPoolUsedSpace|fmt_bytes}
Block Pool Used%:{PercentBlockPoolUsed|fmt_percentage}
DataNodes usages% (Min/Median/Max/stdDev): {#NodeUsage.nodeUsage}{min} / {median} / {max} / {stdDev}{/NodeUsage.nodeUsage}
Live Nodes{NumLiveDataNodes} (Decommissioned: {NumDecomLiveDataNodes})
Dead Nodes{NumDeadDataNodes} (Decommissioned: {NumDecomDeadDataNodes})
Decommissioning Nodes{NumDecommissioningDataNodes}
Number of Under-Replicated Blocks{UnderReplicatedBlocks}
-
-
- -
-
-
NameNode Journal Status
-
-

Current transaction ID: {nn.JournalTransactionInfo.LastAppliedOrWrittenTxId}

- - - - - - {#nn.NameJournalStatus} - - {/nn.NameJournalStatus} - -
Journal ManagerState
{manager}{stream}
-
-
- -
-
-
NameNode Storage
-
- - - {#nn.NameDirStatuses} - {#active}{#helper_dir_status type="Active"/}{/active} - {#failed}{#helper_dir_status type="Failed"/}{/failed} - {/nn.NameDirStatuses} -
Storage DirectoryTypeState
-
-
-
- -
-
Snapshot Summary
-
- {#fs.SnapshotStats} - - - - - - - - - - -
Snapshottable directoriesSnapshotted directories
{SnapshottableDirectories}{Snapshots}
- {/fs.SnapshotStats} -
-
-
- -{#startup} -
-
Startup Progress
-
-

Elapsed Time: {elapsedTime|fmt_time}, Percent Complete: {percentComplete|fmt_percentage}

- - - - - - - - - - {#phases} - - - - - - {#steps root_file=file} - - - - - - {/steps} - {/phases} -
PhaseCompletionElapsed Time
{desc} {file} {size|fmt_bytes}{percentComplete|fmt_percentage}{elapsedTime|fmt_time}
{stepDesc} {stepFile} {stepSize|fmt_bytes} ({count}/{total}){percentComplete|fmt_percentage}
-
-
-{/startup} - -
-
-
Datanode Information
-
-
-
Nodes in operation
-
- - - - - - - - - - - - - - - - {#nn.LiveNodes} - - - - - - - - - - - - - {/nn.LiveNodes} - {#nn.DeadNodes} - - - - - - - - - - - - - {/nn.DeadNodes} -
NodeLast contactAdmin StateCapacityUsedNon DFS UsedRemainingBlocksBlock pool usedFailed Volumes
{name} ({xferaddr}){lastContact}{adminState}{capacity|fmt_bytes}{used|fmt_bytes}{nonDfsUsedSpace|fmt_bytes}{remaining|fmt_bytes}{numBlocks}{blockPoolUsed|fmt_bytes} ({blockPoolUsedPercent|fmt_percentage}){volfails}
{name} ({xferaddr}){lastContact}Dead{?decomissioned}, Decomissioned{/decomissioned}-------
-
-
-
-
Nodes being decomissioned
-
- - - - - - - - - - - {#nn.DecomNodes} - - - - - - - - {/nn.DecomNodes} -
NodeLast contactUnder replicated blocksBlocks with no live replicasUnder Replicated Blocks
In files under construction
{name} ({xferaddr}){lastContact}{underReplicatedBlocks}{decommissionOnlyReplicas}{underReplicateInOpenFiles}
-
-
-
-
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 0ee78739208..7bd96713395 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 @@ -36,6 +36,275 @@
Legacy UI
+ + + +