You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2013/11/08 08:28:04 UTC

svn commit: r1539933 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java

Author: larsh
Date: Fri Nov  8 07:28:04 2013
New Revision: 1539933

URL: http://svn.apache.org/r1539933
Log:
HBASE-9915 Performance: isSeeked() in EncodedScannerV2 always returns false

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

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=1539933&r1=1539932&r2=1539933&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 Fri Nov  8 07:28:04 2013
@@ -997,6 +997,12 @@ public class HFileReaderV2 extends Abstr
           this.meta);
       seeker = dataBlockEncoder.createSeeker(reader.getComparator(), decodingCtx);
     }
+
+    @Override
+    public boolean isSeeked(){
+      return this.block != null;
+    }
+
     /**
      * Updates the current block to be the given {@link HFileBlock}. Seeks to
      * the the first key/value pair.
@@ -1015,6 +1021,9 @@ public class HFileReaderV2 extends Abstr
       updateDataBlockEncoder(block);
       seeker.setCurrentBuffer(getEncodedBuffer(newBlock));
       blockFetches++;
+
+      // Reset the next indexed key
+      this.nextIndexedKey = null;
     }
 
     private void updateDataBlockEncoder(HFileBlock curBlock) {