本文整理汇总了Java中com.datastax.driver.core.policies.ReconnectionPolicy类的典型用法代码示例。如果您正苦于以下问题:Java ReconnectionPolicy类的具体用法?Java ReconnectionPolicy怎么用?Java ReconnectionPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReconnectionPolicy类属于com.datastax.driver.core.policies包,在下文中一共展示了ReconnectionPolicy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* Parse the reconnection policy.
*/
public static ReconnectionPolicy parseReconnectionPolicy(String reconnectionPolicyString) throws
InstantiationException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException,
SecurityException, IllegalArgumentException, InvocationTargetException {
String lb_regex = "([a-zA-Z]*Policy)(\\()(.*)(\\))";
Pattern lb_pattern = Pattern.compile(lb_regex);
Matcher lb_matcher = lb_pattern.matcher(reconnectionPolicyString);
if (lb_matcher.matches()) {
if (lb_matcher.groupCount() > 0) {
// Primary LB policy has been specified
String primaryReconnectionPolicy = lb_matcher.group(1);
String reconnectionPolicyParams = lb_matcher.group(3);
return getReconnectionPolicy(primaryReconnectionPolicy, reconnectionPolicyParams);
}
}
return null;
}
示例2: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* Sets reconnection policy.
*
* @param plc Reconnection policy.
*/
@SuppressWarnings("UnusedDeclaration")
public void setReconnectionPolicy(ReconnectionPolicy plc) {
reconnectionPlc = plc;
invalidate();
}
示例3: readExternal
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的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: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* Sets reconnection policy.
*
* @param plc Reconnection policy.
*/
@SuppressWarnings("UnusedDeclaration")
public void setReconnectionPolicy(ReconnectionPolicy plc) {
this.reconnectionPlc = plc;
invalidate();
}
示例5: getReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public Class<? extends ReconnectionPolicy> getReconnectionPolicy() {
return this.reconnectionPolicy;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:CassandraProperties.java
示例6: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public void setReconnectionPolicy(
Class<? extends ReconnectionPolicy> reconnectionPolicy) {
this.reconnectionPolicy = reconnectionPolicy;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:CassandraProperties.java
示例7: getReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public ReconnectionPolicy getReconnectionPolicy() {
return reconnectionPolicy;
}
示例8: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public void setReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {
this.reconnectionPolicy = reconnectionPolicy;
}
示例9: build
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
@Override
public ReconnectionPolicy build() {
return new ExponentialReconnectionPolicy(baseDelay.toMilliseconds(), maxDelay.toMilliseconds());
}
开发者ID:composable-systems,项目名称:dropwizard-cassandra,代码行数:5,代码来源:ExponentialReconnectionPolicyFactory.java
示例10: build
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
@Override
public ReconnectionPolicy build() {
return new ConstantReconnectionPolicy(delay.toMilliseconds());
}
开发者ID:composable-systems,项目名称:dropwizard-cassandra,代码行数:5,代码来源:ConstantReconnectionPolicyFactory.java
示例11: getReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* @return the reconnectionPolicy
*/
public ReconnectionPolicy getReconnectionPolicy() {
return reconnectionPolicy;
}
示例12: getReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public ReconnectionPolicy getReconnectionPolicy() {
return reconnectionPolicy;
}
示例13: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
public void setReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {
this.reconnectionPolicy = reconnectionPolicy;
}
示例14: withReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* Used to decide how to establish a connection to the cluster in case the current one fails.
* The default if not set is to use an ExponentialRetry Policy.
* The baseDelay and maxDelay are the two time windows that are used to specify the retry attempts
* in an exponential manner
* @param reconnectionPolicy
* @return The builder instance as initially created updated with this value
*/
public ConnectionBuilder withReconnectionPolicy(ReconnectionPolicy reconnectionPolicy)
{
this.reconnectionPolicy = reconnectionPolicy;
return this;
}
示例15: setReconnectionPolicy
import com.datastax.driver.core.policies.ReconnectionPolicy; //导入依赖的package包/类
/**
* @param reconnectionPolicy
* the reconnectionPolicy to set
*/
public void setReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {
this.reconnectionPolicy = reconnectionPolicy;
}