diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java index be8c192..5b049fd 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java @@ -677,11 +677,6 @@ abstract class BufferedDataBlockEncoder implements DataBlockEncoder { } @Override - public int seekToKeyInBlock(byte[] key, int offset, int length, boolean seekBefore) { - return seekToKeyInBlock(new KeyValue.KeyOnlyKeyValue(key, offset, length), seekBefore); - } - - @Override public int seekToKeyInBlock(Cell seekCell, boolean seekBefore) { int rowCommonPrefix = 0; int familyCommonPrefix = 0; diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DataBlockEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DataBlockEncoder.java index 872c22c..8073e54 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DataBlockEncoder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DataBlockEncoder.java @@ -182,27 +182,6 @@ public interface DataBlockEncoder { * previous block if the requested key turns out to be the first key of the * current block. * - * @param key byte array containing the key - * @param offset key position the array - * @param length key length in bytes - * @param seekBefore find the key strictly less than the given key in case - * of an exact match. Does not matter in case of an inexact match. - * @return 0 on exact match, 1 on inexact match. - */ - @Deprecated - int seekToKeyInBlock( - byte[] key, int offset, int length, boolean seekBefore - ); - /** - * Moves the seeker position within the current block to: - *
seekBefore is false
- * seekBefore is true. The caller is responsible for loading the
- * previous block if the requested key turns out to be the first key of the
- * current block.key. Examine the return
- * code to figure whether we found the key or not.
- * Consider the key stream of all the keys in the file,
- * k[0] .. k[n], where there are n keys in the file.
- * @param key Key to find.
- * @return -1, if key < k[0], no position;
- * 0, such that k[i] = key and scanner is left in position i; and
- * 1, such that k[i] < key, and scanner is left in position i.
- * The scanner will position itself between k[i] and k[i+1] where
- * k[i] < key <= k[i+1].
- * If there is no key k[i+1] greater than or equal to the input key, then the
+ * SeekTo or just before the passed cell. Examine the return
+ * code to figure whether we found the cell or not.
+ * Consider the cell stream of all the cells in the file,
+ * c[0] .. c[n], where there are n cells in the file.
+ * @param cell
+ * @return -1, if cell < c[0], no position;
+ * 0, such that c[i] = cell and scanner is left in position i; and
+ * 1, such that c[i] < cell, and scanner is left in position i.
+ * The scanner will position itself between c[i] and c[i+1] where
+ * c[i] < cell <= c[i+1].
+ * If there is no cell c[i+1] greater than or equal to the input cell, then the
* scanner will position itself at the end of the file and next() will return
* false when it is called.
* @throws IOException
*/
- @Deprecated
- int seekTo(byte[] key) throws IOException;
- @Deprecated
- int seekTo(byte[] key, int offset, int length) throws IOException;
+ int seekTo(Cell cell) throws IOException;
- int seekTo(Cell c) throws IOException;
/**
- * Reseek to or just before the passed key. Similar to seekTo
+ * Reseek to or just before the passed cell. Similar to seekTo
* except that this can be called even if the scanner is not at the beginning
* of a file.
- * This can be used to seek only to keys which come after the current position
+ * This can be used to seek only to cells which come after the current position
* of the scanner.
- * Consider the key stream of all the keys in the file,
- * k[0] .. k[n], where there are n keys in the file after
+ * Consider the cell stream of all the cells in the file,
+ * c[0] .. c[n], where there are n cellc in the file after
* current position of HFileScanner.
- * The scanner will position itself between k[i] and k[i+1] where
- * k[i] < key <= k[i+1].
- * If there is no key k[i+1] greater than or equal to the input key, then the
+ * The scanner will position itself between c[i] and c[i+1] where
+ * c[i] < cell <= c[i+1].
+ * If there is no cell c[i+1] greater than or equal to the input cell, then the
* scanner will position itself at the end of the file and next() will return
* false when it is called.
- * @param key Key to find (should be non-null)
- * @return -1, if key < k[0], no position;
- * 0, such that k[i] = key and scanner is left in position i; and
- * 1, such that k[i] < key, and scanner is left in position i.
+ * @param cell Cell to find (should be non-null)
+ * @return -1, if cell < c[0], no position;
+ * 0, such that c[i] = cell and scanner is left in position i; and
+ * 1, such that c[i] < cell, and scanner is left in position i.
* @throws IOException
*/
- @Deprecated
- int reseekTo(byte[] key) throws IOException;
- @Deprecated
- int reseekTo(byte[] key, int offset, int length) throws IOException;
+ int reseekTo(Cell cell) throws IOException;
- int reseekTo(Cell c) throws IOException;
/**
- * Consider the key stream of all the keys in the file,
- * k[0] .. k[n], where there are n keys in the file.
- * @param key Key to find
- * @return false if key <= k[0] or true with scanner in position 'i' such
- * that: k[i] < key. Furthermore: there may be a k[i+1], such that
- * k[i] < key <= k[i+1] but there may also NOT be a k[i+1], and next() will
+ * Consider the cell stream of all the cells in the file,
+ * c[0] .. c[n], where there are n cells in the file.
+ * @param cell Cell to find
+ * @return false if cell <= c[0] or true with scanner in position 'i' such
+ * that: c[i] < cell. Furthermore: there may be a c[i+1], such that
+ * c[i] < cell <= c[i+1] but there may also NOT be a c[i+1], and next() will
* return false (EOF).
* @throws IOException
*/
- @Deprecated
- boolean seekBefore(byte[] key) throws IOException;
- @Deprecated
- boolean seekBefore(byte[] key, int offset, int length) throws IOException;
-
boolean seekBefore(Cell kv) throws IOException;
+
/**
* Positions this scanner at the start of the file.
* @return False if empty file; i.e. a call to next would return false and
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 686df49..042deed 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -1870,8 +1870,7 @@ public class HStore implements Store {
// Unlikely that there'll be an instance of actual first row in table.
if (walkForwardInSingleRow(scanner, firstOnRow, state)) return true;
// If here, need to start backing up.
- while (scanner.seekBefore(firstOnRow.getBuffer(), firstOnRow.getKeyOffset(),
- firstOnRow.getKeyLength())) {
+ while (scanner.seekBefore(firstOnRow)) {
Cell kv = scanner.getKeyValue();
if (!state.isTargetTable(kv)) break;
if (!state.isBetterCandidate(kv)) break;
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
index a8ee091..22fd46e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
@@ -422,8 +422,7 @@ public class StoreFileScanner implements KeyValueScanner {
KeyValue seekKey = KeyValueUtil.createFirstOnRow(key.getRowArray(), key.getRowOffset(),
key.getRowLength());
if (seekCount != null) seekCount.incrementAndGet();
- if (!hfs.seekBefore(seekKey.getBuffer(), seekKey.getKeyOffset(),
- seekKey.getKeyLength())) {
+ if (!hfs.seekBefore(seekKey)) {
close();
return false;
}