-
Notifications
You must be signed in to change notification settings - Fork 19
5879: Return CloseableIterator from QueryWebSocketClient #6447
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
base: develop
Are you sure you want to change the base?
5879: Return CloseableIterator from QueryWebSocketClient #6447
Conversation
| if (!hasNext()) { | ||
| throw new NoSuchElementException(); | ||
| } | ||
| return getRowList().remove(0); |
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.
This will be very inefficient with the ArrayList created in handleResults, as it copies all the data in handleResults, and it will need to move all the elements of the array along one place. I don't think we can merge this as is.
We can add a field for the current index in the list, call get instead of remove here, and stop copying the list in handleResults?
| if (timeoutMilliseconds >= 0) { | ||
| return future.get(timeoutMilliseconds, TimeUnit.MILLISECONDS); | ||
| } else { | ||
| return future.get(); |
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.
I think we should probably avoid calling the get methods every time we call the hasNext/next methods. We can hold the list in a field and check whether that's set before we fall back to the future.
Make sure you have checked all steps below.
Issue
Feature". Note that before an issue is finished, you can still make a pull request by raising a separate issue
for your progress.
Tests
Documentation
separate issue for that below.