Author: jdcryans
Date: Fri Dec 11 19:15:10 2009
New Revision: 889775

URL: http://svn.apache.org/viewvc?rev=889775&view=rev
Log:
HBASE-2040  Fixes to group commit

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=889775&r1=889774&r2=889775&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Dec 11 19:15:10 2009
@@ -123,6 +123,7 @@
                empty oldlogfile.log (Lars George via Stack)
    HBASE-2022  NPE in housekeeping kills RS
    HBASE-2033  Shell scan 'limit' is off by one
+   HBASE-2040  Fixes to group commit
 
   IMPROVEMENTS
    HBASE-1760  Cleanup TODOs in HTable

Modified: 
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: 
http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=889775&r1=889774&r2=889775&view=diff
==============================================================================
--- 
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java 
(original)
+++ 
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java 
Fri Dec 11 19:15:10 2009
@@ -237,7 +237,7 @@
       ", flushlogentries=" + this.flushlogentries +
       ", optionallogflushinternal=" + this.optionalFlushInterval + "ms");
     rollWriter();
-    logSyncerThread = new LogSyncer(this.flushlogentries);
+    logSyncerThread = new LogSyncer(this.optionalFlushInterval);
     Threads.setDaemonThreadRunning(logSyncerThread,
         Thread.currentThread().getName() + ".logSyncer");
   }
@@ -726,9 +726,9 @@
     // Condition used to signal that the sync is done
     private final Condition syncDone = lock.newCondition();
 
-    private final int optionalFlushInterval;
+    private final long optionalFlushInterval;
 
-    LogSyncer(int optionalFlushInterval) {
+    LogSyncer(long optionalFlushInterval) {
       this.optionalFlushInterval = optionalFlushInterval;
     }
 
@@ -739,7 +739,12 @@
 
           // Wait until something has to be synced or do it if we waited enough
           // time (useful if something appends but does not sync).
-          queueEmpty.await(this.optionalFlushInterval, TimeUnit.MILLISECONDS);
+          if (!queueEmpty.await(this.optionalFlushInterval,
+                TimeUnit.MILLISECONDS)) {
+            forceSync = true;
+          }
+
+
 
           // We got the signal, let's syncFS. We currently own the lock so new
           // writes are waiting to acquire it in addToSyncQueue while the ones


Reply via email to