com.datastax.driver.core.policies
Class Policies

java.lang.Object
  extended by com.datastax.driver.core.policies.Policies

public class Policies
extends Object

Policies configured for a Cluster instance.


Constructor Summary
Policies()
           
Policies(LoadBalancingPolicy loadBalancingPolicy, ReconnectionPolicy reconnectionPolicy, RetryPolicy retryPolicy)
          Creates a new Policies object using the provided policies.
 
Method Summary
static LoadBalancingPolicy defaultLoadBalancingPolicy()
          The default load balancing policy.
static ReconnectionPolicy defaultReconnectionPolicy()
          The default reconnection policy.
static RetryPolicy defaultRetryPolicy()
          The default retry policy.
 LoadBalancingPolicy getLoadBalancingPolicy()
          The load balancing policy in use.
 ReconnectionPolicy getReconnectionPolicy()
          The reconnection policy in use.
 RetryPolicy getRetryPolicy()
          The retry policy in use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Policies

public Policies()

Policies

public Policies(LoadBalancingPolicy loadBalancingPolicy,
                ReconnectionPolicy reconnectionPolicy,
                RetryPolicy retryPolicy)
Creates a new Policies object using the provided policies.

Parameters:
loadBalancingPolicy - the load balancing policy to use.
reconnectionPolicy - the reconnection policy to use.
retryPolicy - the retry policy to use.
Method Detail

defaultLoadBalancingPolicy

public static LoadBalancingPolicy defaultLoadBalancingPolicy()
The default load balancing policy.

The default load balancing policy is RoundRobinPolicy.


defaultReconnectionPolicy

public static ReconnectionPolicy defaultReconnectionPolicy()
The default reconnection policy.

The default reconnection policy is an ExponentialReconnectionPolicy where the base delay is 1 second and the max delay is 10 minutes;


defaultRetryPolicy

public static RetryPolicy defaultRetryPolicy()
The default retry policy.

The default retry policy is DefaultRetryPolicy.


getLoadBalancingPolicy

public LoadBalancingPolicy getLoadBalancingPolicy()
The load balancing policy in use.

The load balancing policy defines how Cassandra hosts are picked for queries.

Returns:
the load balancing policy in use.

getReconnectionPolicy

public ReconnectionPolicy getReconnectionPolicy()
The reconnection policy in use.

The reconnection policy defines how often the driver tries to reconnect to a dead node.

Returns:
the reconnection policy in use.

getRetryPolicy

public RetryPolicy getRetryPolicy()
The retry policy in use.

The retry policy defines in which conditions a query should be automatically retries by the driver.

Returns:
the retry policy in use.


Copyright © 2013. All rights reserved.