Constructor
new DseLoadBalancingPolicy(localDcopt, nullable, usedHostPerRemoteDcopt)
Creates a new instance of DseLoadBalancingPolicy.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
localDc |
String |
<optional> <nullable> |
The local datacenter name. |
usedHostPerRemoteDc |
Number |
<optional> |
The number of host per remote datacenter that the policy will yield in a newQueryPlan after the local nodes. |
Methods
(static) createAsWrapper(childPolicy) → {DseLoadBalancingPolicy}
Creates a new instance of
DseLoadBalancingPolicy
wrapping the provided child policy.
Parameters:
Name | Type | Description |
---|---|---|
childPolicy |
LoadBalancingPolicy | The child load balancing policy to be used. |
Returns:
A new
DseLoadBalancingPolicy
instance.
- Type
- DseLoadBalancingPolicy
getDistance(host)
Uses the child policy to return the distance to the host.
Parameters:
Name | Type | Description |
---|---|---|
host |
Host |
init(client, hosts, callback)
Initializes the load balancing policy.
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | |
hosts |
HostMap | |
callback |
function |
newQueryPlan()
Returns the hosts to used for a query.