Java 类com.datastax.driver.core.NettyOptions 实例源码

项目:spring-data-examples    文件:CassandraKeyspace.java   
@Override
protected void before() throws Throwable {

    dependency.before();

    Cluster cluster = Cluster.builder().addContactPoint(getHost()).withPort(getPort())
            .withNettyOptions(new NettyOptions() {
                @Override
                public void onClusterClose(EventLoopGroup eventLoopGroup) {
                    eventLoopGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).syncUninterruptibly();
                }
            }).build();

    Session session = cluster.newSession();

    try {

        if (requiredVersion != null) {

            Version cassandraReleaseVersion = CassandraVersion.getReleaseVersion(session);

            if (cassandraReleaseVersion.isLessThan(requiredVersion)) {
                throw new AssumptionViolatedException(
                        String.format("Cassandra at %s:%s runs in Version %s but we require at least %s", getHost(), getPort(),
                                cassandraReleaseVersion, requiredVersion));
            }
        }

        session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s \n"
                + "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };", keyspaceName));
    } finally {
        session.close();
        cluster.close();
    }
}
项目:ignite    文件:DataSource.java   
/**
 * Sets netty options to use.
 *
 * @param options netty options.
 */
@SuppressWarnings("UnusedDeclaration")
public void setNettyOptions(NettyOptions options) {
    nettyOptions = options;

    invalidate();
}
项目:ignite    文件:DataSource.java   
/** {@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);
}
项目:Lagerta    文件:DataSource.java   
/**
 * Sets netty options to use.
 *
 * @param options netty options.
 */
@SuppressWarnings("UnusedDeclaration")
public void setNettyOptions(NettyOptions options) {
    this.nettyOptions = options;
    invalidate();
}
项目:Lagerta    文件:DataSource.java   
/** {@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);
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @return the nettyOptions
 */
public NettyOptions getNettyOptions() {
    return nettyOptions;
}
项目:spring-cloud-connectors    文件:CassandraClusterConfig.java   
public NettyOptions getNettyOptions() {
    return nettyOptions;
}
项目:spring-cloud-connectors    文件:CassandraClusterConfig.java   
public void setNettyOptions(NettyOptions nettyOptions) {
    this.nettyOptions = nettyOptions;
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @param nettyOptions
 *            the nettyOptions to set
 */
public void setNettyOptions(NettyOptions nettyOptions) {
    this.nettyOptions = nettyOptions;
}