-
Couldn't load subscription status.
- Fork 3.4k
HBASE-28012 Avoid CellUtil.cloneRow in BufferedEncodedSeeker #5347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-28012 Avoid CellUtil.cloneRow in BufferedEncodedSeeker #5347
Conversation
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java
Show resolved
Hide resolved
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java
Show resolved
Hide resolved
|
Thanks for opening this PR. Overall LGTM. Just a simple question and a follow on task. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
…dedSeeker (apache#5347) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
…5347) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1) (cherry picked from commit 9aa8b9b) Change-Id: I246d035e9138fa4c0927b6a0ecbaf1bc9f9a31ad
What
This PR updates BufferedEncodedSeeker#seekToKeyInBlock (used extensively in the reverse scan path) to avoid calling
CellUtil.cloneRowfor off-heap Cell seek targets.Implementation Notes
For
private"findCommonPrefix*" methods, I used an invariant that the "right" cell is always akeyOnlyKvand therefore on-heap.For the
public"compareCommonPrefix*" methods, I added extra paths to them to account for either the left or right cell to be on or off-heap to keep the behavior optimized for any external callers. In practice, I believe these methods are internal toBufferedEncodedSeekerexcept for a few unit tests so I'd be open to reducing the branching to just optimize for the left cell being able to be on/off-heap. I'd love some feedback on this approach as it adds a fair amount of extra code that isn't strictly necessary for this PR.I also added a test that is a clone of a current
seekToKeyInBlockover a sample of data with the only variation being that the seek target cell is an off-heap cell instead of an on-heap one to give coverage over the new path here. Let me know if you'd like to see any more tests.Testing
Some (naive and non-JMH) testing has been done of the new code path here. It looks to be in the range of about 20-30% faster than the old path for off-heap cell seek targets. Obviously, take these numbers with a grain of salt as they're not from JMH.
HBASE-28012