Skip to content

Commit

Permalink
Attempt to set pooling options to check if there is any effect on ins…
Browse files Browse the repository at this point in the history
…ertion.
  • Loading branch information
Stefan Negrea committed Feb 10, 2016
1 parent e8f138a commit 61eb63e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@

import com.codahale.metrics.MetricRegistry;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.PoolingOptions;
import com.datastax.driver.core.SSLOptions;
import com.datastax.driver.core.Session;
import com.google.common.base.Throwables;
Expand Down Expand Up @@ -282,6 +284,13 @@ private Session createSession() {
}
}

PoolingOptions poolingOptions = new PoolingOptions()
.setCoreConnectionsPerHost(HostDistance.LOCAL, 40)
.setMaxConnectionsPerHost(HostDistance.LOCAL, 100)
.setCoreConnectionsPerHost(HostDistance.REMOTE, 20)
.setMaxConnectionsPerHost(HostDistance.REMOTE, 40);
clusterBuilder.withPoolingOptions(poolingOptions);

Cluster cluster = clusterBuilder.build();
cluster.init();
Session createdSession = null;
Expand Down

0 comments on commit 61eb63e

Please sign in to comment.