hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1531790 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase: io/hfile/HFile.java io/hfile/HFileReaderV2.java regionserver/StoreFile.java regionserver/StoreFileScanner.java
Date Mon, 14 Oct 2013 03:57:16 GMT
Author: larsh
Date: Mon Oct 14 03:57:15 2013
New Revision: 1531790

URL: http://svn.apache.org/r1531790
Log:
HBASE-9751 Excessive readpoints checks in StoreFileScanner

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java?rev=1531790&r1=1531789&r2=1531790&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java Mon
Oct 14 03:57:15 2013
@@ -497,6 +497,8 @@ public class HFile {
     void close(boolean evictOnClose) throws IOException;
 
     DataBlockEncoding getEncodingOnDisk();
+
+    boolean hasMVCCInfo();
   }
 
   /**

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java?rev=1531790&r1=1531789&r2=1531790&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
Mon Oct 14 03:57:15 2013
@@ -387,6 +387,11 @@ public class HFileReaderV2 extends Abstr
     return dataBlockEncoder.diskToCacheFormat(hfileBlock, isCompaction);
   }
 
+  @Override
+  public boolean hasMVCCInfo() {
+    return includesMemstoreTS && decodeMemstoreTS;
+  }
+
   /**
    * Compares the actual type of a block retrieved from cache or disk with its
    * expected type and throws an exception in case of a mismatch. Expected

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1531790&r1=1531789&r2=1531790&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
Mon Oct 14 03:57:15 2013
@@ -1070,7 +1070,7 @@ public class StoreFile {
                                                boolean isCompaction) {
       return new StoreFileScanner(this,
                                  getScanner(cacheBlocks, pread,
-                                            isCompaction), !isCompaction);
+                                            isCompaction), !isCompaction, reader.hasMVCCInfo());
     }
 
     /**

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java?rev=1531790&r1=1531789&r2=1531790&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
Mon Oct 14 03:57:15 2013
@@ -53,6 +53,7 @@ public class StoreFileScanner implements
   private KeyValue delayedSeekKV;
 
   private boolean enforceMVCC = false;
+  private boolean hasMVCCInfo = false;
 
   private static AtomicLong seekCount;
 
@@ -62,10 +63,11 @@ public class StoreFileScanner implements
    * Implements a {@link KeyValueScanner} on top of the specified {@link HFileScanner}
    * @param hfs HFile scanner
    */
-  public StoreFileScanner(StoreFile.Reader reader, HFileScanner hfs, boolean useMVCC) {
+  public StoreFileScanner(StoreFile.Reader reader, HFileScanner hfs, boolean useMVCC, boolean
hasMVCC) {
     this.reader = reader;
     this.hfs = hfs;
     this.enforceMVCC = useMVCC;
+    this.hasMVCCInfo = hasMVCC;
   }
 
   /**
@@ -126,7 +128,8 @@ public class StoreFileScanner implements
       if (cur != null) {
         hfs.next();
         cur = hfs.getKeyValue();
-        skipKVsNewerThanReadpoint();
+        if (hasMVCCInfo)
+          skipKVsNewerThanReadpoint();
       }
     } catch(IOException e) {
       throw new IOException("Could not iterate " + this, e);
@@ -146,7 +149,7 @@ public class StoreFileScanner implements
 
         cur = hfs.getKeyValue();
 
-        return skipKVsNewerThanReadpoint();
+        return !hasMVCCInfo ? true : skipKVsNewerThanReadpoint();
       } finally {
         realSeekDone = true;
       }
@@ -166,7 +169,7 @@ public class StoreFileScanner implements
         }
         cur = hfs.getKeyValue();
 
-        return skipKVsNewerThanReadpoint();
+        return !hasMVCCInfo ? true : skipKVsNewerThanReadpoint();
       } finally {
         realSeekDone = true;
       }



Mime
View raw message