Class Policies
Represents the policies configured for a ICluster instance.
Inheritance
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class Policies
Constructors
Policies()
Declaration
public Policies()
Policies(ILoadBalancingPolicy, IReconnectionPolicy, IRetryPolicy)
Creates a new Policies
object using the provided policies.
Declaration
public Policies(ILoadBalancingPolicy loadBalancingPolicy, IReconnectionPolicy reconnectionPolicy, IRetryPolicy retryPolicy)
Parameters
Type | Name | Description |
---|---|---|
ILoadBalancingPolicy | loadBalancingPolicy | the load balancing policy to use. |
IReconnectionPolicy | reconnectionPolicy | the reconnection policy to use. |
IRetryPolicy | retryPolicy | the retry policy to use. |
Properties
ColumnEncryptionPolicy
Gets the column encryption policy in use. See IColumnEncryptionPolicy.
Declaration
public IColumnEncryptionPolicy ColumnEncryptionPolicy { get; }
Property Value
Type | Description |
---|---|
IColumnEncryptionPolicy |
DefaultLoadBalancingPolicy
DEPRECATED: Use NewDefaultLoadBalancingPolicy(string) instead. Providing the local datacenter will be mandatory in the next major version of the driver.
The default load balancing policy.
The default load balancing policy is DefaultLoadBalancingPolicy as a wrapper around TokenAwarePolicy with DCAwareRoundRobinPolicy as child policy.
Declaration
public static ILoadBalancingPolicy DefaultLoadBalancingPolicy { get; }
Property Value
Type | Description |
---|---|
ILoadBalancingPolicy |
DefaultPolicies
Gets a new instance Policies containing default policies of the driver.
Declaration
public static Policies DefaultPolicies { get; }
Property Value
Type | Description |
---|---|
Policies |
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;Declaration
public static IReconnectionPolicy DefaultReconnectionPolicy { get; }
Property Value
Type | Description |
---|---|
IReconnectionPolicy |
DefaultRetryPolicy
The default retry policy.The default retry policy is DefaultRetryPolicy
Declaration
public static IRetryPolicy DefaultRetryPolicy { get; }
Property Value
Type | Description |
---|---|
IRetryPolicy |
DefaultSpeculativeExecutionPolicy
The ISpeculativeExecutionPolicy to be used by default.
The default is NoSpeculativeExecutionPolicy.
Declaration
public static ISpeculativeExecutionPolicy DefaultSpeculativeExecutionPolicy { get; }
Property Value
Type | Description |
---|---|
ISpeculativeExecutionPolicy |
DefaultTimestampGenerator
Gets a new instance of the default ITimestampGenerator policy.
The default ITimestampGenerator is AtomicMonotonicTimestampGenerator
Declaration
public static ITimestampGenerator DefaultTimestampGenerator { get; }
Property Value
Type | Description |
---|---|
ITimestampGenerator |
LoadBalancingPolicy
Gets the load balancing policy in use.
The load balancing policy defines how Cassandra hosts are picked for queries.
Declaration
public ILoadBalancingPolicy LoadBalancingPolicy { get; }
Property Value
Type | Description |
---|---|
ILoadBalancingPolicy |
ReconnectionPolicy
Gets the reconnection policy in use.
The reconnection policy defines how often the driver tries to reconnect to a dead node.
Declaration
public IReconnectionPolicy ReconnectionPolicy { get; }
Property Value
Type | Description |
---|---|
IReconnectionPolicy |
RetryPolicy
Gets the retry policy in use.
The retry policy defines in which conditions a query should be automatically retries by the driver.
Declaration
public IRetryPolicy RetryPolicy { get; }
Property Value
Type | Description |
---|---|
IRetryPolicy |
SpeculativeExecutionPolicy
Gets the SpeculativeExecutionPolicy in use.
Declaration
public ISpeculativeExecutionPolicy SpeculativeExecutionPolicy { get; }
Property Value
Type | Description |
---|---|
ISpeculativeExecutionPolicy |
TimestampGenerator
Gets the ITimestampGenerator instance in use.
Declaration
public ITimestampGenerator TimestampGenerator { get; }
Property Value
Type | Description |
---|---|
ITimestampGenerator |
Methods
NewDefaultLoadBalancingPolicy(string)
Creates a new instance of the default load balancing policy with the provided local datacenter. This is equivalent to:
new DefaultLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy(localDc)))
Declaration
public static ILoadBalancingPolicy NewDefaultLoadBalancingPolicy(string localDc)
Parameters
Type | Name | Description |
---|---|---|
string | localDc |
Returns
Type | Description |
---|---|
ILoadBalancingPolicy |