本文整理汇总了Java中com.datastax.driver.core.NettyOptions类的典型用法代码示例。如果您正苦于以下问题:Java NettyOptions类的具体用法?Java NettyOptions怎么用?Java NettyOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NettyOptions类属于com.datastax.driver.core包,在下文中一共展示了NettyOptions类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
@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();
}
}
示例2: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* Sets netty options to use.
*
* @param options netty options.
*/
@SuppressWarnings("UnusedDeclaration")
public void setNettyOptions(NettyOptions options) {
nettyOptions = options;
invalidate();
}
示例3: readExternal
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/** {@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);
}
示例4: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* Sets netty options to use.
*
* @param options netty options.
*/
@SuppressWarnings("UnusedDeclaration")
public void setNettyOptions(NettyOptions options) {
this.nettyOptions = options;
invalidate();
}
示例5: getNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* @return the nettyOptions
*/
public NettyOptions getNettyOptions() {
return nettyOptions;
}
示例6: getNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
public NettyOptions getNettyOptions() {
return nettyOptions;
}
示例7: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
public void setNettyOptions(NettyOptions nettyOptions) {
this.nettyOptions = nettyOptions;
}
示例8: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* @param nettyOptions
* the nettyOptions to set
*/
public void setNettyOptions(NettyOptions nettyOptions) {
this.nettyOptions = nettyOptions;
}