Skip to content

Commit

Permalink
added downgrading retry policy to avoid problems with consistency lev…
Browse files Browse the repository at this point in the history
…els and nodes down
  • Loading branch information
EinsamHauer committed Aug 3, 2016
1 parent 0a1931b commit 9c63646
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.iponweb.disthene.reader</groupId>
<artifactId>disthene-reader</artifactId>
<packaging>jar</packaging>
<version>0.2.37</version>
<version>0.2.38</version>
<name>disthene-reader</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.datastax.driver.core.*;
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;
import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy;
import com.datastax.driver.core.policies.TokenAwarePolicy;
import com.datastax.driver.core.policies.WhiteListPolicy;
import net.iponweb.disthene.reader.config.StoreConfiguration;
Expand Down Expand Up @@ -44,6 +45,7 @@ public CassandraService(StoreConfiguration storeConfiguration) {
.withSocketOptions(socketOptions)
.withCompression(ProtocolOptions.Compression.LZ4)
.withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy()))
.withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE)
.withPoolingOptions(poolingOptions)
.withQueryOptions(new QueryOptions().setConsistencyLevel(ConsistencyLevel.valueOf(storeConfiguration.getConsistency())))
.withProtocolVersion(ProtocolVersion.V2)
Expand Down

0 comments on commit 9c63646

Please sign in to comment.