Class DseLoadBalancingPolicy
A load balancing policy designed to run against DSE cluster.
For most executions, the query plan will be determined by the child load balancing policy. Except for some cases, like graph analytics queries, for which it uses the preferred analytics graph server previously obtained by driver as first host in the query plan.
Inheritance
Implements
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public class DseLoadBalancingPolicy : ILoadBalancingPolicy
Constructors
DseLoadBalancingPolicy(ILoadBalancingPolicy)
Creates a new instance of DseLoadBalancingPolicy wrapping the provided child policy.
Declaration
public DseLoadBalancingPolicy(ILoadBalancingPolicy childPolicy)
Parameters
Type | Name | Description |
---|---|---|
ILoadBalancingPolicy | childPolicy |
DseLoadBalancingPolicy(String)
Creates a new instance of DseLoadBalancingPolicy given the name of the local datacenter.
Declaration
public DseLoadBalancingPolicy(string localDc)
Parameters
Type | Name | Description |
---|---|---|
System.String | localDc | The name of the local datacenter (case-sensitive) |
DseLoadBalancingPolicy(String, Int32)
Creates a new instance of DseLoadBalancingPolicy given the name of the local datacenter and the amount of host per remote datacenter to use for failover for the local hosts.
Declaration
[Obsolete("The usedHostsPerRemoteDc parameter will be removed in the next major release of the driver. DC failover should not be done in the driver, which does not have the necessary context to know what makes sense considering application semantics. See https://datastax-oss.atlassian.net/browse/CSHARP-722")]
public DseLoadBalancingPolicy(string localDc, int usedHostsPerRemoteDc)
Parameters
Type | Name | Description |
---|---|---|
System.String | localDc | The name of the local datacenter (case-sensitive) |
System.Int32 | usedHostsPerRemoteDc | The amount of host per remote datacenter that the policy should yield in a new query plan after the local nodes. Note that this parameter will be removed in the next major version of the driver. |
Methods
CreateDefault()
Creates the default load balancing policy, using DefaultLoadBalancingPolicy as child policy.
Declaration
public static DseLoadBalancingPolicy CreateDefault()
Returns
Type | Description |
---|---|
DseLoadBalancingPolicy |
CreateDefault(String)
Creates the default load balancing policy, using NewDefaultLoadBalancingPolicy(String) to create the child policy.
Declaration
public static DseLoadBalancingPolicy CreateDefault(string localDc)
Parameters
Type | Name | Description |
---|---|---|
System.String | localDc |
Returns
Type | Description |
---|---|
DseLoadBalancingPolicy |
Distance(Host)
Returns the distance as determined by the child policy.
Declaration
public HostDistance Distance(Host host)
Parameters
Type | Name | Description |
---|---|---|
Host | host |
Returns
Type | Description |
---|---|
HostDistance |
Initialize(ICluster)
Initializes the policy.
Declaration
public void Initialize(ICluster cluster)
Parameters
Type | Name | Description |
---|---|---|
ICluster | cluster |
NewQueryPlan(String, IStatement)
Returns the hosts to used for a query.
Declaration
public IEnumerable<Host> NewQueryPlan(string keyspace, IStatement statement)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | |
IStatement | statement |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Host> |