[ 
https://issues.apache.org/jira/browse/HDFS-6013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13916145#comment-13916145
 ] 

Haohui Mai commented on HDFS-6013:
----------------------------------

{code}
+    <div class="page-header"><h1>RollingUpgrade In-Progress</h1></div>
+    <table class="table table-bordered table-striped">
+      <tr><th>StartTime:</th><td>{#helper_date_tostring 
value=startTime}(={startTime}){/helper_date_tostring}</td></tr>
+      <tr><th>Created Rollback Images:</th><td>{#createdRollbackImages} true 
{:else} false {/createdRollbackImages} </td></tr>
+      <tr><th>Block Pool ID:</th><td>{blockPoolId}</td></tr>
+    </table>
+  {/RollingUpgradeStatus}
+
{code}

There is no point to report the timestamp. There is no need to report 
{{BlockPoolId} as well (it will be the same as the one in the overview). 
Therefore, the following code would work:

{code}
<p>Rolling upgrade started at {#helper_date_tostring value="{startTime}"/}.
{#createdRollbackImages}
Rollback image has been created. Proceed to upgrade the daemons.
{:else}
Rollback image has not been created.
{/createdRollbackImages}
</p>
{code}

I understand that it might be useful to emphasize that the cluster is in the 
rolling upgrade mode, but since we've already placed the text in a different 
background, it looks like to me that what might fit better in the page visually 
is to print the information in normal font size, without using the 
{{page-header}}.

{code}
{#helper_date_tostring value=startTime}(={startTime}){/helper_date_tostring}
{code}

It is sufficient to write:

{code}
{#helper_date_tostring value="{startTime}"/}
{code}

{code}
+      "helper_date_tostring" : function (chunk, ctx, bodies, params) {
+         var value = dust.helpers.tap(params.value, chunk, ctx);
+         return chunk.write('' + new Date(value).toLocaleString() + ' (=' + 
value + ')');
       }
{code}

Let's use single quote for consistency. There should be a forced type 
conversion in the function as well:

{code}
      'helper_date_tostring' : function (chunk, ctx, bodies, params) {
        var value = dust.helpers.tap(params.value, chunk, ctx);
        return chunk.write(new Date(Number(value)).toLocaleString());
      }
{code}

Nit: the indentation starts from the first single quote, thus it is easy to 
have three spaces instead of two in indentation :-)

> add rollingUpgrade information to  latest UI
> --------------------------------------------
>
>                 Key: HDFS-6013
>                 URL: https://issues.apache.org/jira/browse/HDFS-6013
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>            Reporter: Vinayakumar B
>            Assignee: Vinayakumar B
>         Attachments: Current.jpg, HDFS-6013.patch, HDFS-6013.patch, 
> HDFS-6013.patch, HDFS-6013.patch, Previous.jpg, Snap-28-2-2014.jpg, 
> rolling-upgrade-ui.png
>
>
> Rolling Upgrade information should be shown in the latest NameNode UI.
> For this RollingUpgrade information should be exposed as jmx bean.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to