Prechádzať zdrojové kódy

HADOOP-2026. Namenode prints out one log line for "Number of transactions"
at most once every minute. (Dhruba Borthakur)



git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@583926 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 18 rokov pred
rodič
commit
c0c9540657

+ 3 - 0
CHANGES.txt

@@ -382,6 +382,9 @@ Trunk (unreleased changes)
     edits log. Reduce the number of syncs by double-buffering the changes
     to the transaction log. (Dhruba Borthakur)
 
+    HADOOP-2026. Namenode prints out one log line for "Number of transactions"
+    at most once every minute. (Dhruba Borthakur)
+
 
 Release 0.14.2 - 2007-10-09
 

+ 2 - 1
src/java/org/apache/hadoop/dfs/FSEditLog.java

@@ -209,6 +209,7 @@ class FSEditLog {
     fsimage = image;
     isSyncRunning = false;
     metrics = NameNode.getNameNodeMetrics();
+    lastPrintTime = FSNamesystem.now();
   }
 
   private File getEditFile(int idx) {
@@ -718,7 +719,7 @@ class FSEditLog {
   //
   private void printStatistics(boolean force) {
     long now = FSNamesystem.now();
-    if (lastPrintTime + 60000 < now && !force) {
+    if (lastPrintTime + 60000 > now && !force) {
       return;
     }
     if (editStreams == null) {