From 20c2734f12b5eb117bea33026d4de7f0d4d44c4e Mon Sep 17 00:00:00 2001 From: larsh Date: Fri, 8 Nov 2013 07:28:04 +0000 Subject: [PATCH] HBASE-9915 Performance: isSeeked() in EncodedScannerV2 always returns false git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1539933 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java index 30d2bb0495d..949a2176fce 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java @@ -997,6 +997,12 @@ public class HFileReaderV2 extends AbstractHFileReader { 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 AbstractHFileReader { updateDataBlockEncoder(block); seeker.setCurrentBuffer(getEncodedBuffer(newBlock)); blockFetches++; + + // Reset the next indexed key + this.nextIndexedKey = null; } private void updateDataBlockEncoder(HFileBlock curBlock) {