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.


Field Summary
static LoadBalancingPolicy DEFAULT_LOAD_BALANCING_POLICY
          The default load balancing policy.
static ReconnectionPolicy DEFAULT_RECONNECTION_POLICY
          The default reconnection policy.
static RetryPolicy DEFAULT_RETRY_POLICY
          The default retry policy.
 
Constructor Summary
Policies()
           
Policies(LoadBalancingPolicy loadBalancingPolicy, ReconnectionPolicy reconnectionPolicy, RetryPolicy retryPolicy)
          Creates a new Policies object using the provided policies.
 
Method Summary
 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
 

Field Detail

DEFAULT_LOAD_BALANCING_POLICY

public static final LoadBalancingPolicy DEFAULT_LOAD_BALANCING_POLICY
The default load balancing policy.

The default load balancing policy is RoundRobinPolicy.


DEFAULT_RECONNECTION_POLICY

public static final ReconnectionPolicy DEFAULT_RECONNECTION_POLICY
The default reconnection policy.

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


DEFAULT_RETRY_POLICY

public static final RetryPolicy DEFAULT_RETRY_POLICY
The default retry policy.

The default retry policy is DefaultRetryPolicy.

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

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.