本文整理了Java中com.datastax.driver.core.policies.Policies.<init>()
方法的一些代码示例,展示了Policies.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Policies.<init>()
方法的具体详情如下:
包路径:com.datastax.driver.core.policies.Policies
类名称:Policies
方法名:<init>
[英]Creates a new Policies object using the provided policies.
This constructor use the default IdentityTranslater.
[中]使用提供的策略创建新策略对象。
此构造函数使用默认的IdentityTranslater。
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
/**
* Builds the final object from this builder.
*
* <p>Any field that hasn't been set explicitly will get its default value.
*
* @return the object.
*/
public Policies build() {
return new Policies(
loadBalancingPolicy == null ? defaultLoadBalancingPolicy() : loadBalancingPolicy,
reconnectionPolicy == null ? defaultReconnectionPolicy() : reconnectionPolicy,
retryPolicy == null ? defaultRetryPolicy() : retryPolicy,
addressTranslator == null ? defaultAddressTranslator() : addressTranslator,
timestampGenerator == null ? defaultTimestampGenerator() : timestampGenerator,
speculativeExecutionPolicy == null
? defaultSpeculativeExecutionPolicy()
: speculativeExecutionPolicy);
}
}
代码示例来源:origin: stackoverflow.com
public void actionPerformed(ActionEvent e) {
new Policies ();
}
代码示例来源:origin: com.stratio.cassandra/cassandra-driver-core
public Configuration() {
this(new Policies(),
new ProtocolOptions(),
new PoolingOptions(),
new SocketOptions(),
new MetricsOptions(),
new QueryOptions());
}
代码示例来源:origin: com.yugabyte/cassandra-driver-core
/**
* Builds the final object from this builder.
* <p/>
* Any field that hasn't been set explicitly will get its default value.
*
* @return the object.
*/
public Policies build() {
return new Policies(
loadBalancingPolicy == null ? defaultLoadBalancingPolicy() : loadBalancingPolicy,
reconnectionPolicy == null ? defaultReconnectionPolicy() : reconnectionPolicy,
retryPolicy == null ? defaultRetryPolicy() : retryPolicy,
addressTranslator == null ? defaultAddressTranslator() : addressTranslator,
timestampGenerator == null ? defaultTimestampGenerator() : timestampGenerator,
speculativeExecutionPolicy == null ? defaultSpeculativeExecutionPolicy() : speculativeExecutionPolicy);
}
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
/**
* Builds the final object from this builder.
* <p/>
* Any field that hasn't been set explicitly will get its default value.
*
* @return the object.
*/
public Policies build() {
return new Policies(
loadBalancingPolicy == null ? Policies.defaultLoadBalancingPolicy() : loadBalancingPolicy,
Objects.firstNonNull(reconnectionPolicy, Policies.defaultReconnectionPolicy()),
Objects.firstNonNull(retryPolicy, Policies.defaultRetryPolicy()),
Objects.firstNonNull(addressTranslator, Policies.defaultAddressTranslator()),
Objects.firstNonNull(timestampGenerator, Policies.defaultTimestampGenerator()),
Objects.firstNonNull(speculativeExecutionPolicy, Policies.defaultSpeculativeExecutionPolicy()));
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
/**
* Builds the final object from this builder.
* <p/>
* Any field that hasn't been set explicitly will get its default value.
*
* @return the object.
*/
public Policies build() {
return new Policies(
loadBalancingPolicy == null ? Policies.defaultLoadBalancingPolicy() : loadBalancingPolicy,
Objects.firstNonNull(reconnectionPolicy, Policies.defaultReconnectionPolicy()),
Objects.firstNonNull(retryPolicy, Policies.defaultRetryPolicy()),
Objects.firstNonNull(addressTranslator, Policies.defaultAddressTranslator()),
Objects.firstNonNull(timestampGenerator, Policies.defaultTimestampGenerator()),
Objects.firstNonNull(speculativeExecutionPolicy, Policies.defaultSpeculativeExecutionPolicy()));
}
}
代码示例来源:origin: com.stratio.cassandra/cassandra-driver-core
/**
* The configuration that will be used for the new cluster.
* <p>
* You <b>should not</b> modify this object directly because changes made
* to the returned object may not be used by the cluster build.
* Instead, you should use the other methods of this {@code Builder}.
*
* @return the configuration to use for the new cluster.
*/
@Override
public Configuration getConfiguration() {
Policies policies = new Policies(
loadBalancingPolicy == null ? Policies.defaultLoadBalancingPolicy() : loadBalancingPolicy,
reconnectionPolicy == null ? Policies.defaultReconnectionPolicy() : reconnectionPolicy,
retryPolicy == null ? Policies.defaultRetryPolicy() : retryPolicy,
addressTranslater == null ? Policies.defaultAddressTranslater() : addressTranslater
);
return new Configuration(policies,
new ProtocolOptions(port, protocolVersion, sslOptions, authProvider).setCompression(compression),
poolingOptions == null ? new PoolingOptions() : poolingOptions,
socketOptions == null ? new SocketOptions() : socketOptions,
metricsEnabled ? new MetricsOptions(jmxEnabled) : null,
queryOptions == null ? new QueryOptions() : queryOptions);
}
内容来源于网络,如有侵权,请联系作者删除!