hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1531791 - in /hbase/branches/0.96/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:59:25 GMT
Author: larsh
Date: Mon Oct 14 03:59:24 2013
New Revision: 1531791

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

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

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

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java?rev=1531791&r1=1531790&r2=1531791&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
Mon Oct 14 03:59:24 2013
@@ -363,6 +363,11 @@ public class HFileReaderV2 extends Abstr
     }
   }
 
+  @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/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1531791&r1=1531790&r2=1531791&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
Mon Oct 14 03:59:24 2013
@@ -1135,7 +1135,7 @@ public class StoreFile {
                                                boolean isCompaction) {
       return new StoreFileScanner(this,
                                  getScanner(cacheBlocks, pread,
-                                            isCompaction), !isCompaction);
+                                            isCompaction), !isCompaction, reader.hasMVCCInfo());
     }
 
     /**

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java?rev=1531791&r1=1531790&r2=1531791&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
Mon Oct 14 03:59:24 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