Skip to content

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

Merged
merged 5 commits into from
Feb 18, 2016
Merged

Streaming cursor #125

merged 5 commits into from
Feb 18, 2016

Conversation

technige
Copy link
Contributor

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.

(parameters == null) || (parameters.isEmpty()) ? NO_PARAMETERS : unmodifiableMap( parameters );
final SummaryBuilder summaryBuilder = new SummaryBuilder( new Statement( statement, unmodifiableParameters ) );

this.runResponseCollector = new StreamCollector()
Copy link
Contributor

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

@Override
public void keys( String[] names )
{
keys = new ArrayList<>( Arrays.asList( names ) );
Copy link
Member

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

@@ -77,6 +222,9 @@ public int index( String key )

public List<String> keys()
{
while (keys == null && !done) {
Copy link
Member

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?

Copy link
Contributor Author

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.

boggle pushed a commit that referenced this pull request Feb 18, 2016
@boggle boggle merged commit f0b0504 into 1.0 Feb 18, 2016
@technige technige deleted the 1.0-streaming branch February 18, 2016 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants