-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Merged
Apache9
merged 2 commits into
apache:master
from
jbewing:HBASE-28012-avoid-clone-row-in-dbe-seek
Aug 15, 2023
Merged
HBASE-28012 Avoid CellUtil.cloneRow in BufferedEncodedSeeker #5347
Apache9
merged 2 commits into
apache:master
from
jbewing:HBASE-28012-avoid-clone-row-in-dbe-seek
Aug 15, 2023
+223
−23
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Apache9
reviewed
Aug 13, 2023
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. |
Apache9
approved these changes
Aug 15, 2023
Apache9
pushed a commit
that referenced
this pull request
Aug 15, 2023
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Apache9
pushed a commit
that referenced
this pull request
Aug 15, 2023
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Apache9
pushed a commit
that referenced
this pull request
Aug 15, 2023
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
Apache9
pushed a commit
that referenced
this pull request
Aug 15, 2023
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
bbeaudreault
pushed a commit
to HubSpot/hbase
that referenced
this pull request
Aug 21, 2023
…dedSeeker (apache#5347) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1)
vinayakphegde
pushed a commit
to vinayakphegde/hbase
that referenced
this pull request
Apr 4, 2024
…5347) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 2fb2ae1) (cherry picked from commit 9aa8b9b) Change-Id: I246d035e9138fa4c0927b6a0ecbaf1bc9f9a31ad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This PR updates BufferedEncodedSeeker#seekToKeyInBlock (used extensively in the reverse scan path) to avoid calling
CellUtil.cloneRow
for off-heap Cell seek targets.Implementation Notes
For
private
"findCommonPrefix*" methods, I used an invariant that the "right" cell is always akeyOnlyKv
and 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 toBufferedEncodedSeeker
except 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
seekToKeyInBlock
over 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