-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Segregate advance and advanceUninterruptibly flow in postJoinCursor to allow for interrupts in advance #15222
Changes from 1 commit
4d22ab3
c91dc76
8be0109
0e2f01d
33e5483
5f1d7f4
6fea6df
3fd3f5c
cd7078a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,15 @@ public static PostJoinCursor wrap( | |
} | ||
|
||
private void advanceToMatch() | ||
{ | ||
if (valueMatcher != null) { | ||
while (!isDone() && !valueMatcher.matches(false)) { | ||
baseCursor.advance(); | ||
} | ||
} | ||
} | ||
|
||
private void advanceToMatchUninterruptibly() | ||
{ | ||
if (valueMatcher != null) { | ||
while (!isDone() && !valueMatcher.matches(false)) { | ||
|
@@ -99,15 +108,15 @@ public Filter getPostJoinFilter() | |
@Override | ||
public void advance() | ||
{ | ||
advanceUninterruptibly(); | ||
BaseQuery.checkInterrupted(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a note on why the checkInterrupted() is not needed anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment. |
||
baseCursor.advance(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be good to put some comments as in why this change is being done in the code for a future developer to follow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added comments. |
||
advanceToMatch(); | ||
} | ||
|
||
@Override | ||
public void advanceUninterruptibly() | ||
{ | ||
baseCursor.advanceUninterruptibly(); | ||
advanceToMatch(); | ||
advanceToMatchUninterruptibly(); | ||
} | ||
|
||
@Override | ||
|
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.
Please leave a comment here that this can be a long-running CPU call. Which is why advanceUninterruptibly is not directly used in advance() call unlike other cursors. Please link the github issue in the comment.
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.
Done