本文整理汇总了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();
}
}
开发者ID:Just-Fun,项目名称:spring-data-examples,代码行数:36,代码来源:CassandraKeyspace.java
示例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();
}
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:DataSource.java
示例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);
}
开发者ID:apache,项目名称:ignite,代码行数:29,代码来源:DataSource.java
示例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();
}
开发者ID:epam,项目名称:Lagerta,代码行数:11,代码来源:DataSource.java
示例5: getNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* @return the nettyOptions
*/
public NettyOptions getNettyOptions() {
return nettyOptions;
}
开发者ID:joef551,项目名称:camel-cql,代码行数:7,代码来源:ClusterBean.java
示例6: getNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
public NettyOptions getNettyOptions() {
return nettyOptions;
}
开发者ID:spring-cloud,项目名称:spring-cloud-connectors,代码行数:4,代码来源:CassandraClusterConfig.java
示例7: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
public void setNettyOptions(NettyOptions nettyOptions) {
this.nettyOptions = nettyOptions;
}
开发者ID:spring-cloud,项目名称:spring-cloud-connectors,代码行数:4,代码来源:CassandraClusterConfig.java
示例8: setNettyOptions
import com.datastax.driver.core.NettyOptions; //导入依赖的package包/类
/**
* @param nettyOptions
* the nettyOptions to set
*/
public void setNettyOptions(NettyOptions nettyOptions) {
this.nettyOptions = nettyOptions;
}
开发者ID:joef551,项目名称:camel-cql,代码行数:8,代码来源:ClusterBean.java
注:本文中的com.datastax.driver.core.NettyOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论