-
Type:
Sub-task
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0.0
-
Component/s: None
-
Labels:None
-
Hadoop Flags:Reviewed
The getFirstKeyInBlock() in HFileReaderImpl is returning a BB. It is getting used in seekBefore cases. Because we return a BB we create a KeyOnlyKV once for comparison
if (reader.getComparator() .compareKeyIgnoresMvcc( new KeyValue.KeyOnlyKeyValue(firstKey.array(), firstKey.arrayOffset(), firstKey.limit()), key) >= 0) { long previousBlockOffset = seekToBlock.getPrevBlockOffset(); // The key we are interested in if (previousBlockOffset == -1) { // we have a 'problem', the key we want is the first of the file. return false; } ........
And if the compare fails we again create another KeyOnlyKv
Cell firstKeyInCurrentBlock = new KeyValue.KeyOnlyKeyValue(Bytes.getBytes(firstKey)); loadBlockAndSeekToKey(seekToBlock, firstKeyInCurrentBlock, true, key, true);
So one object will be enough and that can be returned by getFirstKeyInBlock. Also will be useful when we go with Buffered backed server cell to change in one place.
- relates to
-
HBASE-13945 Prefix_Tree seekBefore() does not work correctly
-
- Closed
-