builder.withUsedHostsPerRemoteDc(config.getDcAwareUsedHostsPerRemoteDc()); if (config.isDcAwareAllowRemoteDCsForLocal()) { builder.allowRemoteDCsForLocalConsistencyLevel();
&& "true".equalsIgnoreCase(allowRemoteDCsForLocalConsistencyLevel)) policyBuilder.allowRemoteDCsForLocalConsistencyLevel();
.withUsedHostsPerRemoteDc(getConfiguration(). getTokenAwareLoadBalancingUsedHostsPerRemoteDc()) .allowRemoteDCsForLocalConsistencyLevel() .build()
builder.withUsedHostsPerRemoteDc(config.getDcAwareUsedHostsPerRemoteDc()); if (config.isDcAwareAllowRemoteDCsForLocal()) { builder.allowRemoteDCsForLocalConsistencyLevel();
builder.withUsedHostsPerRemoteDc(config.getDcAwareUsedHostsPerRemoteDc()); if (config.isDcAwareAllowRemoteDCsForLocal()) { builder.allowRemoteDCsForLocalConsistencyLevel();
builder = builder.withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build()); } else { builder = builder.withLoadBalancingPolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy( (DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy((DCAwareRoundRobinPolicy.builder().build())); builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(
builder = builder.withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build()); } else { builder = builder.withLoadBalancingPolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy( (DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy((DCAwareRoundRobinPolicy.builder().build())); builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(
builder = builder.withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build()); } else { builder = builder.withLoadBalancingPolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy( (DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy((DCAwareRoundRobinPolicy.builder().build())); builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter) .allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( if (allowRemoteDCsForLocalConsistencyLevel) { builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy( DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build())); } else { builder = builder.withLoadBalancingPolicy(
.withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder() .allowRemoteDCsForLocalConsistencyLevel() .withUsedHostsPerRemoteDc(2) .build())
@Override public LoadBalancingPolicy build() { DCAwareRoundRobinPolicy.Builder builder = DCAwareRoundRobinPolicy.builder(); if (allowRemoteDCsForLocalConsistencyLevel == Boolean.TRUE) { builder.allowRemoteDCsForLocalConsistencyLevel(); } if (localDC != null) { builder.withLocalDc(localDC); } if (usedHostsPerRemoteDC != null) { builder.withUsedHostsPerRemoteDc(usedHostsPerRemoteDC); } return builder.build(); } }
public DCAwareRoundRobinPolicy(String localDc, int usedHostsPerRemoteDc, boolean allowRemoteDCsForLocalConsistencyLevel) { builder.withLocalDc(localDc) .withUsedHostsPerRemoteDc(usedHostsPerRemoteDc); if(allowRemoteDCsForLocalConsistencyLevel){ builder.allowRemoteDCsForLocalConsistencyLevel(); } }
@Override public LoadBalancingPolicy build() { DCAwareRoundRobinPolicy.Builder builder = DCAwareRoundRobinPolicy.builder(); if (allowRemoteDCsForLocalConsistencyLevel == Boolean.TRUE) { builder.allowRemoteDCsForLocalConsistencyLevel(); } if (localDC != null) { builder.withLocalDc(localDC); } if (usedHostsPerRemoteDC != null) { builder.withUsedHostsPerRemoteDc(usedHostsPerRemoteDC); } return builder.build(); } }
.withLoadBalancingPolicy( DCAwareRoundRobinPolicy.builder() .allowRemoteDCsForLocalConsistencyLevel() .withUsedHostsPerRemoteDc(2) .build())