Skip to content

Java 8, CompletionStage in async and stress test improvements #406

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 6 commits into from
Sep 27, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Sep 22, 2017

This PR bumps required java version to 8 so that we can use CompletionStage and CompletableFuture in async API.

Stress test has been split into a CC and single instance test. It now also tests async API.

@lutovich lutovich force-pushed the 1.5-completable-future branch 17 times, most recently from 87c56d9 to 59d735f Compare September 22, 2017 20:24
@zhenlineo zhenlineo changed the base branch from 1.5-async to 1.5 September 25, 2017 16:09
@lutovich lutovich force-pushed the 1.5-completable-future branch 2 times, most recently from 7849bbb to dcf946f Compare September 26, 2017 16:39
Commit changes source and target java version to 1.8 and makes all
public async APIs use `CompletionStage` instead of `Response`, which
is now removed. This allows easier future chaining and makes API much
more usable. Currently all internal futures are converted to
`CompletionStage` at the highest level before returning to the user.
Split `CausalClusteringStressIT` into two separate tests - one for
single instance and one for CC. Added testing of async API. Extracted
all infra classes to top level.
This commit makes driver use `CompletableFuture` instead of
netty-based `InternalFuture` and `InternalPromise`.
Both blocking and async commands added to execute wrong query "RETURN"
and query failing at runtime "UNWIND [10, 5, 0] AS x RETURN 10 / x".
Queries are executed both through session and transaction. These
commands are useful to verify that all resources (like netty channel)
are correctly released on errors.
@lutovich lutovich force-pushed the 1.5-completable-future branch from dcf946f to 93a29b7 Compare September 27, 2017 11:31
@zhenlineo zhenlineo merged commit 4b3a45e into neo4j:1.5 Sep 27, 2017
@lutovich lutovich deleted the 1.5-completable-future branch September 27, 2017 11:47
}
else
{
queueRecord( record );
}
}

public synchronized InternalFuture<Record> nextAsync()
public synchronized CompletionStage<Record> nextAsync()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve concurrent performance among #onRecord() and #nextAsync() methods by avoiding method level synchronized access. We will have to keep an eye on recordFuture and queuing records (we can maybe use ConcurrentLinkedQueue instead of Queue).

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.

3 participants