socketOptions.setSoLinger(config.getClientSoLinger()); clusterBuilder.withSocketOptions(socketOptions);
.withPoolingOptions(poolingOptions) .withQueryOptions(queryOptions) .withSocketOptions(socketOptions) .withReconnectionPolicy(Policies.defaultReconnectionPolicy())
/** * Create new cassandra cluster using builder. */ @PostConstruct public void init() { Cluster.Builder builder = Cluster.builder() .addContactPointsWithPorts(parseNodeList(nodeList)) .withClusterName(clusterName) .withSocketOptions(clientOptions.getSocketOptions()); if (!useJmx) { builder.withoutJMXReporting(); } if (disableMetrics) { builder.withoutMetrics(); } if (useCredentials) { builder.withCredentials(username, password); } if (useSsl) { builder.withSSL(); } builder.withQueryOptions(clientOptions.getQueryOptions()); builder.withCompression(parseCompression(compression)); cluster = builder.build(); }
@SuppressWarnings("unused") public Cluster.Builder createClusterLowReadTimeout() { // Low Read Timeout to trigger retry behavior. return Cluster.builder().withSocketOptions(new SocketOptions().setReadTimeoutMillis(1000)); }
failingHosts.get(3).address, missingHostAddress) .withSocketOptions(socketOptions) .withReconnectionPolicy(reconnectionPolicy) .withPoolingOptions(poolingOptions)
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
connectionBuilder.withSocketOptions(getSocketOptions(connectionProperties));
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
builder.withSocketOptions(opts); return builder;
.withReconnectionPolicy(new ConstantReconnectionPolicy(5000)) .withLoadBalancingPolicy(loadBalancingPolicy) .withSocketOptions(socketOptions) .withProtocolVersion(ccm().getProtocolVersion()) .build());
Cluster cluster = this.createClusterBuilder() .withSocketOptions( new SocketOptions() .setConnectTimeoutMillis(readTimeout)
socketOptions.setReadTimeoutMillis(readTimeout * SECOND); builder.withSocketOptions(socketOptions);
private void createCluster(int core, int max) { PoolingOptions poolingOptions = new PoolingOptions().setConnectionsPerHost(LOCAL, core, max); SocketOptions socketOptions = new SocketOptions().setReadTimeoutMillis(1000); cluster = Cluster.builder() .addContactPoints(scassandra.address(1).getAddress()) .withPort(scassandra.getBinaryPort()) .withQueryOptions(nonDebouncingQueryOptions()) .withPoolingOptions(poolingOptions) .withSocketOptions(socketOptions) .withReconnectionPolicy(new ConstantReconnectionPolicy(1000)) .build(); cluster.connect(); }
@SuppressWarnings("unused") public Cluster.Builder createClusterLowReadTimeout() { // Low Read Timeout to trigger retry behavior. return Cluster.builder().withSocketOptions(new SocketOptions().setReadTimeoutMillis(1000)); }
builder = builder.withSocketOptions(sockOptions);
@Override protected void load() { String hostIp = EmbeddedCassandraServerHelper.getHost(); int port = EmbeddedCassandraServerHelper.getNativeTransportPort(); cluster = new Cluster.Builder().addContactPoints(hostIp).withPort(port).withSocketOptions(getSocketOptions()) .build(); session = cluster.connect(); CQLDataLoader dataLoader = new CQLDataLoader(session); dataLoader.load(dataSet); session = dataLoader.getSession(); }