-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-13113][Core] Remove unnecessary bit operation when decoding page number #11002
Conversation
@@ -312,7 +312,7 @@ public static long encodePageNumberAndOffset(int pageNumber, long offsetInPage) | |||
|
|||
@VisibleForTesting | |||
public static int decodePageNumber(long pagePlusOffsetAddress) { | |||
return (int) ((pagePlusOffsetAddress & MASK_LONG_UPPER_13_BITS) >>> OFFSET_BITS); | |||
return (int) (pagePlusOffsetAddress >> OFFSET_BITS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we absolutely sure that the top bit is not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it should be >>> not >>. I will update this.
Test build #50486 has finished for PR 11002 at commit
|
7f1439b
to
4b846dd
Compare
retest this please. |
Test build #50489 has finished for PR 11002 at commit
|
This change looks good to me, maybe @JoshRosen who was the last to touch that line can take a look? |
Seems OK, are there other redundant usages? The constant name including 13 seems overly specific too |
I will check again. But yesterday I just found this. |
Hmm, I just found this after another check. |
@davies Can you take a look if this is proper to merge? Thanks. |
LGTM, merging this into master. |
JIRA: https://issues.apache.org/jira/browse/SPARK-13113
As we shift bits right, looks like the bitwise AND operation is unnecessary.