hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1589158 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal: FSHLog.java HLog.java
Date Tue, 22 Apr 2014 15:04:32 GMT
Author: nkeywal
Date: Tue Apr 22 15:04:32 2014
New Revision: 1589158

URL: http://svn.apache.org/r1589158
Log:
HBASE-11028 FSLog: Avoid an extra sync if the current transaction is already sync'd

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java?rev=1589158&r1=1589157&r2=1589158&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
Tue Apr 22 15:04:32 2014
@@ -1486,8 +1486,11 @@ class FSHLog implements HLog, Syncable {
   }
 
   @Override
-  // txid is unused.  txid is an implementation detail.  It should not leak outside of WAL.
   public void sync(long txid) throws IOException {
+    if (this.highestSyncedSequence.get() >= txid){
+      // Already sync'd.
+      return;
+    }
     publishSyncThenBlockOnCompletion();
   }
 

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=1589158&r1=1589157&r2=1589158&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
Tue Apr 22 15:04:32 2014
@@ -342,16 +342,17 @@ public interface HLog {
 
   void hflush() throws IOException;
 
+  /**
+   * Sync what we have in the WAL.
+   * @throws IOException
+   */
   void sync() throws IOException;
 
   /**
+   * Sync the WAL if the txId was not already sync'd.
    * @param txid Transaction id to sync to.
    * @throws IOException
-   * @deprecated Since 0.96.2.  Just call {@link #sync()}.  <code>txid</code>
should not be allowed
-   * outside the implementation.
    */
-  // TODO: Why is this exposed?  txid is an internal detail.
-  @Deprecated
   void sync(long txid) throws IOException;
 
   /**



Mime
View raw message