[
https://issues.apache.org/jira/browse/HDFS-5196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945405#comment-13945405
]
Haohui Mai commented on HDFS-5196:
----------------------------------
The patch generally looks good. There are some minor comments needed to be
addressed:
{code}
+ 'array_length' : function (v) {
+ var cnt = 0;
+ for (var i in v) {
+ cnt++;
+ }
+ return cnt;
{code}
You can follow what dust.js does
(https://github.com/linkedin/dustjs/wiki/Dust-Tutorial#size_keyxxx___size_helper_Available_in_Dust_V11_release),
and derives a new version that evaluates the key.
Otherwise, I think that the following code will print {{Snapshottable
directories:}} instead of {{Snapshottable directories:0}}
{code}
+<div class="page-header"><h1><small>Snapshottable directories:
{SnapshotStats.directory|array_length}</small></div>
{code}
I guess for this version let's just remove {{array_length}} and
{code}
+<div class="page-header"><h1><small>Snapshottable directories:
{SnapshotStats.directory|array_length}</small></div>
+<div class="page-header"><h1><small>Snapshotted directories:
{SnapshotStats.snapshots|array_length}</small></div>
{code}
Let's address it in a separate jira.
{code}
+ var HELPERS = {
+ 'helper_to_permission': function (chunk, ctx, bodies, params) {
+ var p = ctx.current().permission;
+ var symbols = [ '---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx'
];
+ var sticky = p > 1000;
+
+ var res = "";
+ res = symbols[(p >>> 6) & 7] + symbols[(p >>> 3) & 7] + symbols[p & 7];
+
+ if (sticky) {
+ var otherExec = ((ctx.current().permission % 10) & 1) == 1;
+ res = res.substr(0, res.length - 1) + (otherExec ? 't' : 'T');
+ }
+
+ chunk.write('d' + res);
+ return chunk;
+ }
+ };
+
{code}
You can move it to the filter object in {{dfs-dust.js}} and remove the
duplicated one in {{explorer.js}}.
Nit: there are some trailing white spaces.
> Provide more snapshot information in WebUI
> ------------------------------------------
>
> Key: HDFS-5196
> URL: https://issues.apache.org/jira/browse/HDFS-5196
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: snapshots
> Affects Versions: 3.0.0
> Reporter: Haohui Mai
> Assignee: Shinichi Yamashita
> Priority: Minor
> Attachments: HDFS-5196-2.patch, HDFS-5196-3.patch, HDFS-5196-4.patch,
> HDFS-5196-5.patch, HDFS-5196-6.patch, HDFS-5196-7.patch, HDFS-5196-8.patch,
> HDFS-5196.patch, HDFS-5196.patch, HDFS-5196.patch, snapshot-new-webui.png,
> snapshottable-directoryList.png, snapshotteddir.png
>
>
> The WebUI should provide more detailed information about snapshots, such as
> all snapshottable directories and corresponding number of snapshots
> (suggested in HDFS-4096).
--
This message was sent by Atlassian JIRA
(v6.2#6252)