-
Notifications
You must be signed in to change notification settings - Fork 155
Streaming cursor #125
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
Streaming cursor #125
Conversation
(parameters == null) || (parameters.isEmpty()) ? NO_PARAMETERS : unmodifiableMap( parameters ); | ||
final SummaryBuilder summaryBuilder = new SummaryBuilder( new Statement( statement, unmodifiableParameters ) ); | ||
|
||
this.runResponseCollector = new StreamCollector() |
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 could maybe be extracted as a method
dc425c0
to
4289c65
Compare
@Override | ||
public void keys( String[] names ) | ||
{ | ||
keys = new ArrayList<>( Arrays.asList( names ) ); |
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.
no need for an ArrayList
caf756f
to
2959d90
Compare
@@ -77,6 +222,9 @@ public int index( String key ) | |||
|
|||
public List<String> keys() | |||
{ | |||
while (keys == null && !done) { |
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.
can this become an endless loop?
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.
Only if the server responds incorrectly and in that case and Exception will be thrown, breaking out of the loop.
This PR adds streaming to the Java Driver. This passes control of message retrieval to the ResultCursor class and, as such, alters slightly where expections may be thrown from. In addition, each ResultCursor instance now has a recordBuffer (instead of a static list of records) which is used in the case where the cursor needs to "soak up" records from the network due to a later cursor traversing its records first.
Note that the ConnectionPoolIT test is disabled for now. From what I can tell, the occasional failures seen with this test are connected to the new startup scripts which can return before the server port is available. Fixing this should probably be a separate issue and not something to hold up this PR.