瀏覽代碼

HADOOP-1613. Fix DFS Health page to display correct time of last contact. Contributed by Dhruba.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@556696 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父節點
當前提交
2978b20a47
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 3 0
      CHANGES.txt
  2. 3 3
      src/webapps/dfs/dfshealth.jsp

+ 3 - 0
CHANGES.txt

@@ -359,6 +359,9 @@ Trunk (unreleased changes)
 112. HADOOP-1562.  Add JVM metrics, including GC and logging stats.
      (David Bowen via cutting)
 
+113. HADOOP-1613.  Fix "DFS Health" page to display correct time of
+     last contact.  (Dhruba Borthakur via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 3 - 3
src/webapps/dfs/dfshealth.jsp

@@ -14,7 +14,6 @@
 <%!
   FSNamesystem fsn = FSNamesystem.getFSNamesystem();
   String namenodeLabel = fsn.getDFSNameNodeMachine() + ":" + fsn.getDFSNameNodePort();
-  long currentTime;
   JspHelper jspHelper = new JspHelper();
 
   int rowNum = 0;
@@ -97,8 +96,10 @@
                          (d.isDecommissionInProgress() ? "Decommission In Progress":
                           "In Service"));
     
+    long timestamp = d.getLastUpdate();
+    long currentTime = System.currentTimeMillis();
     out.print("<td class=\"lastcontact\"> " +
-              ((currentTime - d.getLastUpdate())/1000) +
+              ((currentTime - timestamp)/1000) +
 	      "<td class=\"adminstate\">" +
               adminState +
 	      "<td class=\"size\">" +
@@ -165,7 +166,6 @@
     }
     else {
         
-        currentTime = System.currentTimeMillis();
 	out.print( "<div id=\"dfsnodetable\"> "+
                    "<a name=\"LiveNodes\" id=\"title\">" +
                    "Live Datanodes : " + live.size() + "</a>" +