Skip to content
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

Cassandra async improvements #1149

Merged
merged 3 commits into from
Oct 5, 2018
Merged

Conversation

a14e
Copy link
Contributor

@a14e a14e commented Sep 1, 2018

Problems

  • cassandra async and sreamings libs are not fully async. Prepare statements receiving is blocking
  • prepare statements cache uses hashCode, (simple tests produce collision with rate about 0.012%)

Solution

  • modified PrepareStatementCache for work with async statements
  • added async vesion of statement receiving
  • updated async/streaming contexts
  • replaced hashCode with more precise Hashing.goodFastHash from Guava

* fully async prepared statements
* async prepared statements cache
@a14e a14e changed the title Cassandra async impromenets Cassandra async improvements Sep 1, 2018
@mosyp
Copy link
Collaborator

mosyp commented Sep 12, 2018

@@ -48,7 +48,7 @@ class CassandraAsyncContext[N <: NamingStrategy](
executeQuery(cql, prepare, extractor).map(handleSingleResult)

def executeAction[T](cql: String, prepare: Prepare = identityPrepare)(implicit ec: ExecutionContext): Future[Unit] = {
Future(prepare(this.prepare(cql))).flatMap {
this.prepareAsync(cql).map(prepare).flatMap {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm thinking of moving prepare into prepareAsync call or in flatMap, which can reduce additional call to ec

@fwbrasil fwbrasil merged commit 91698d8 into zio:master Oct 5, 2018
deusaquilus pushed a commit to deusaquilus2/quill that referenced this pull request Oct 25, 2018
* * more random prepared statements
* fully async prepared statements
* async prepared statements cache

* * format fix

* * sbt scalariformFormat
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