use of com.datastax.driver.core.Cluster.Builder in project cassandra-driver-mapping by valchkou.
the class MappingSessionTest method init.
@BeforeClass
public static void init() {
String node = "127.0.0.1";
Builder builder = Cluster.builder();
builder.addContactPoint(node);
builder.withLoadBalancingPolicy(LatencyAwarePolicy.builder(new RoundRobinPolicy()).build());
builder.withReconnectionPolicy(new ConstantReconnectionPolicy(1000L));
cluster = builder.build();
session = cluster.connect();
Cache<String, PreparedStatement> cache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MILLISECONDS).maximumSize(1).concurrencyLevel(1).build();
MappingSession.setStatementCache(cache);
}
Aggregations