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

Haohui Mai commented on HDFS-7214:
----------------------------------

Thanks for working on this.

{code}
-  
+  /** the time when the namenode became active */
+  private volatile long activeStateStartTime;
{code}

This is a read-dominant workload. It makes more sense to use {{AtomicLong}} 
here. You can call {{lazySet()}} to update the timestamp.

{code} 
+  @Override // NameNodeStatusMXBean
+  public String getNNTransitToActiveTime() {
+    if (activeStateStartTime == 0) {
+      return "N/A";
+    }
+    return new Date(activeStateStartTime).toString();
+  }
+
{code}

It might be better to return the timestamp and let the UI to format the date, 
considering locales and timezone issues.

> Display the time when NN became active on the webUI
> ---------------------------------------------------
>
>                 Key: HDFS-7214
>                 URL: https://issues.apache.org/jira/browse/HDFS-7214
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Siqi Li
>            Assignee: Siqi Li
>              Labels: BB2015-05-TBR
>         Attachments: HDFS-7214.v1.patch, HDFS-7214.v2.patch, 
> HDFS-7214.v3.patch
>
>
> The currently NN webUI displayed JVM start up. It will be useful to show when 
> NN became active. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to