Constructor and Description |
---|
Policies() |
Policies(LoadBalancingPolicy loadBalancingPolicy,
ReconnectionPolicy reconnectionPolicy,
RetryPolicy retryPolicy,
AddressTranslater addressTranslater,
SpeculativeExecutionPolicy speculativeExecutionPolicy)
Creates a new
Policies object using the provided policies. |
Policies(LoadBalancingPolicy loadBalancingPolicy,
ReconnectionPolicy reconnectionPolicy,
RetryPolicy retryPolicy,
SpeculativeExecutionPolicy speculativeExecutionPolicy)
Creates a new
Policies object using the provided policies. |
Modifier and Type | Method and Description |
---|---|
static AddressTranslater |
defaultAddressTranslater()
The default address translater.
|
static LoadBalancingPolicy |
defaultLoadBalancingPolicy()
The default load balancing policy.
|
static ReconnectionPolicy |
defaultReconnectionPolicy()
The default reconnection policy.
|
static RetryPolicy |
defaultRetryPolicy()
The default retry policy.
|
static SpeculativeExecutionPolicy |
defaultSpeculativeExecutionPolicy()
The default speculative retry policy.
|
AddressTranslater |
getAddressTranslater()
The address translater in use.
|
LoadBalancingPolicy |
getLoadBalancingPolicy()
The load balancing policy in use.
|
ReconnectionPolicy |
getReconnectionPolicy()
The reconnection policy in use.
|
RetryPolicy |
getRetryPolicy()
The retry policy in use.
|
SpeculativeExecutionPolicy |
getSpeculativeExecutionPolicy()
The speculative execution policy in use.
|
public Policies()
public Policies(LoadBalancingPolicy loadBalancingPolicy, ReconnectionPolicy reconnectionPolicy, RetryPolicy retryPolicy, SpeculativeExecutionPolicy speculativeExecutionPolicy)
Policies
object using the provided policies.
This constructor use the default IdentityTranslater
.
loadBalancingPolicy
- the load balancing policy to use.reconnectionPolicy
- the reconnection policy to use.retryPolicy
- the retry policy to use.public Policies(LoadBalancingPolicy loadBalancingPolicy, ReconnectionPolicy reconnectionPolicy, RetryPolicy retryPolicy, AddressTranslater addressTranslater, SpeculativeExecutionPolicy speculativeExecutionPolicy)
Policies
object using the provided policies.loadBalancingPolicy
- the load balancing policy to use.reconnectionPolicy
- the reconnection policy to use.retryPolicy
- the retry policy to use.addressTranslater
- the address translater to use.public static LoadBalancingPolicy defaultLoadBalancingPolicy()
The default load balancing policy is DCAwareRoundRobinPolicy
with token
awareness (so new TokenAwarePolicy(new DCAwareRoundRobinPolicy())
).
Note that this policy shuffles the replicas when token awareness is used, see
TokenAwarePolicy.TokenAwarePolicy(LoadBalancingPolicy,boolean)
for an
explanation of the tradeoffs.
public static ReconnectionPolicy defaultReconnectionPolicy()
The default reconnection policy is an ExponentialReconnectionPolicy
where the base delay is 1 second and the max delay is 10 minutes;
public static RetryPolicy defaultRetryPolicy()
The default retry policy is DefaultRetryPolicy
.
public static AddressTranslater defaultAddressTranslater()
The default address translater is IdentityTranslater
.
public static SpeculativeExecutionPolicy defaultSpeculativeExecutionPolicy()
The default speculative retry policy is a NoSpeculativeExecutionPolicy
.
public LoadBalancingPolicy getLoadBalancingPolicy()
The load balancing policy defines how Cassandra hosts are picked for queries.
public ReconnectionPolicy getReconnectionPolicy()
The reconnection policy defines how often the driver tries to reconnect to a dead node.
public RetryPolicy getRetryPolicy()
The retry policy defines in which conditions a query should be automatically retries by the driver.
public AddressTranslater getAddressTranslater()
public SpeculativeExecutionPolicy getSpeculativeExecutionPolicy()
Copyright © 2012–2015. All rights reserved.