com.datastax.driver.core.NettyOptions Java Examples

The following examples show how to use com.datastax.driver.core.NettyOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CQLSession.java    From cassandra-sidecar with Apache License 2.0 5 votes vote down vote up
@Inject
public CQLSession(Configuration configuration)
{
    inet = InetSocketAddress.createUnresolved(configuration.getCassandraHost(), configuration.getCassandraPort());
    wlp = new WhiteListPolicy(new RoundRobinPolicy(), Collections.singletonList(inet));
    this.nettyOptions = new NettyOptions();
    this.queryOptions = new QueryOptions().setConsistencyLevel(ConsistencyLevel.ONE);
    this.reconnectionPolicy = new ExponentialReconnectionPolicy(1000,
                                                                configuration.getHealthCheckFrequencyMillis());
}
 
Example #2
Source File: CQLSession.java    From cassandra-sidecar with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
CQLSession(InetSocketAddress target, NettyOptions options)
{
    inet = target;
    wlp = new WhiteListPolicy(new RoundRobinPolicy(), Collections.singletonList(inet));
    this.nettyOptions = options;
    this.queryOptions = new QueryOptions().setConsistencyLevel(ConsistencyLevel.ONE);
    reconnectionPolicy = new ExponentialReconnectionPolicy(100, 1000);
}
 
Example #3
Source File: DataSource.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fetchSize = (Integer)in.readObject();
    readConsistency = (ConsistencyLevel)in.readObject();
    writeConsistency = (ConsistencyLevel)in.readObject();
    user = U.readString(in);
    pwd = U.readString(in);
    port = (Integer)in.readObject();
    contactPoints = (List<InetAddress>)in.readObject();
    contactPointsWithPorts = (List<InetSocketAddress>)in.readObject();
    maxSchemaAgreementWaitSeconds = (Integer)in.readObject();
    protoVer = (Integer)in.readObject();
    compression = U.readString(in);
    useSSL = (Boolean)in.readObject();
    collectMetrix = (Boolean)in.readObject();
    jmxReporting = (Boolean)in.readObject();
    creds = (Credentials)in.readObject();
    loadBalancingPlc = (LoadBalancingPolicy)readObject(in);
    reconnectionPlc = (ReconnectionPolicy)readObject(in);
    addrTranslator = (AddressTranslator)readObject(in);
    speculativeExecutionPlc = (SpeculativeExecutionPolicy)readObject(in);
    authProvider = (AuthProvider)readObject(in);
    sslOptions = (SSLOptions)readObject(in);
    poolingOptions = (PoolingOptions)readObject(in);
    sockOptions = (SocketOptions)readObject(in);
    nettyOptions = (NettyOptions)readObject(in);
}
 
Example #4
Source File: HealthServiceIntegrationTest.java    From cassandra-sidecar with Apache License 2.0 4 votes vote down vote up
public HealthCheck healthCheckFor(BoundNode node, NettyOptions shared)
{
    CQLSession session = new CQLSession(node.inetSocketAddress(), shared);
    sessions.add(session);
    return new HealthCheck(session);
}
 
Example #5
Source File: DataSource.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * Sets netty options to use.
 *
 * @param options netty options.
 */
public void setNettyOptions(NettyOptions options) {
    nettyOptions = options;

    invalidate();
}
 
Example #6
Source File: CassandraClusterConfig.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public NettyOptions getNettyOptions() {
	return nettyOptions;
}
 
Example #7
Source File: CassandraClusterConfig.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public void setNettyOptions(NettyOptions nettyOptions) {
	this.nettyOptions = nettyOptions;
}