本文整理了Java中com.datastax.driver.core.Configuration.builder()
方法的一些代码示例,展示了Configuration.builder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.builder()
方法的具体详情如下:
包路径:com.datastax.driver.core.Configuration
类名称:Configuration
方法名:builder
[英]Returns a builder to create a new Configuration object.
You only need this if you are building the configuration yourself. If you use Cluster#builder(), it will be done under the hood for you.
[中]
代码示例来源:origin: com.github.ddth/ddth-cql-utils
Policies policies = polBuilder.build();
Configuration.Builder confBuilder = Configuration.builder();
if (this.metricsOptions != null) {
confBuilder.withMetricsOptions(metricsOptions);
代码示例来源:origin: com.netflix.astyanax/astyanax-cql
public Configuration getJDConfig() {
return Configuration.builder()
.withPolicies(getPolicies())
.withProtocolOptions(getProtocolOptions())
.withPoolingOptions(getPoolingOptions())
.withSocketOptions(getSocketOptions())
.withMetricsOptions(getMetricsOptions())
.withQueryOptions(getQueryOptions())
.build();
}
代码示例来源:origin: com.netflix.astyanax/astyanax-test
private static AstyanaxContext<Keyspace> keyspaceWithJavaDriver(String keyspaceName) {
final String SEEDS = "localhost";
Supplier<List<Host>> HostSupplier = new Supplier<List<Host>>() {
@Override
public List<Host> get() {
Host host = new Host(SEEDS, -1);
return Collections.singletonList(host);
}
};
ProtocolOptions protocolOptions = new ProtocolOptions(9042);
Configuration jdConfig = Configuration.builder()
.withProtocolOptions(protocolOptions)
.build();
AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
.forKeyspace(keyspaceName)
.withHostSupplier(HostSupplier)
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl())
.withConnectionPoolConfiguration(new JavaDriverConnectionPoolConfigurationImpl(jdConfig))
.buildKeyspace(CqlFamilyFactory.getInstance());
return context;
}
代码示例来源:origin: com.netflix.astyanax/astyanax-cql
public JavaDriverConnectionPoolConfigurationImpl build() {
Policies policies = Policies.builder()
.withLoadBalancingPolicy(loadBalancingPolicy)
.withReconnectionPolicy(reconnectionPolicy)
.withRetryPolicy(retryPolicy).build();
ProtocolOptions protocolOptions = (nativeProtocolPort == -1) ? new ProtocolOptions() : new ProtocolOptions(nativeProtocolPort);
MetricsOptions metricsOptions = new MetricsOptions(true, jmxReportingEnabled);
return new JavaDriverConnectionPoolConfigurationImpl(Configuration.builder()
.withPolicies(policies)
.withProtocolOptions(protocolOptions)
.withPoolingOptions(poolingOptions)
.withSocketOptions(socketOptions)
.withMetricsOptions(metricsOptions)
.withQueryOptions(queryOptions).build());
}
内容来源于网络,如有侵权,请联系作者删除!