hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1532432 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
Date Tue, 15 Oct 2013 17:03:07 GMT
Author: tedyu
Date: Tue Oct 15 17:03:07 2013
New Revision: 1532432

URL: http://svn.apache.org/r1532432
Log:
HBASE-9753 Excessive readpoint checks in MemstoreScanner


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java?rev=1532432&r1=1532431&r2=1532432&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
Tue Oct 15 17:03:07 2013
@@ -678,7 +678,7 @@ public class MemStore implements HeapSiz
     this.lock.readLock().lock();
     try {
       return Collections.<KeyValueScanner>singletonList(
-          new MemStoreScanner());
+          new MemStoreScanner(MultiVersionConsistencyControl.getThreadReadPoint()));
     } finally {
       this.lock.readLock().unlock();
     }
@@ -730,6 +730,8 @@ public class MemStore implements HeapSiz
     // The allocator and snapshot allocator at the time of creating this scanner
     volatile MemStoreLAB allocatorAtCreation;
     volatile MemStoreLAB snapshotAllocatorAtCreation;
+    
+    private long readPoint;
 
     /*
     Some notes...
@@ -752,9 +754,10 @@ public class MemStore implements HeapSiz
       the adds to kvset in the MemStoreScanner.
     */
 
-    MemStoreScanner() {
+    MemStoreScanner(long readPoint) {
       super();
 
+      this.readPoint = readPoint;
       kvsetAtCreation = kvset;
       snapshotAtCreation = snapshot;
       if (allocator != null) {
@@ -768,13 +771,11 @@ public class MemStore implements HeapSiz
     }
 
     private KeyValue getNext(Iterator<KeyValue> it) {
-      long readPoint = MultiVersionConsistencyControl.getThreadReadPoint();
-
       KeyValue v = null;
       try {
         while (it.hasNext()) {
           v = it.next();
-          if (v.getMvccVersion() <= readPoint) {
+          if (v.getMvccVersion() <= this.readPoint) {
             return v;
           }
         }



Mime
View raw message