Class: DCAwareRoundRobinPolicy

policies/loadBalancing~DCAwareRoundRobinPolicy(localDcopt, nullable)

new DCAwareRoundRobinPolicy(localDcopt, nullable)

A data-center aware Round-robin load balancing policy. This policy provides round-robin queries over the nodes of the local data center.

Parameters:
Name Type Attributes Description
localDc String <optional>
<nullable>

local datacenter name. This value overrides the 'localDataCenter' Client option
and is useful for cases where you have multiple execution profiles that you intend on using for routing requests to different data centers.

Source:

Extends

  • LoadBalancingPolicy

Members

localHostsArray :Array

Type:
  • Array
Source:

Methods

getDistance(host)

Returns the distance depending on the datacenter.

Parameters:
Name Type Description
host Host
Source:

getOptions()

Gets an associative array containing the policy options.

Source:

init(client, hosts, callback)

Initializes the load balancing policy.

Parameters:
Name Type Description
client Client
hosts HostMap
callback function
Source:

newQueryPlan(keyspace, executionOptions, callback)

It returns an iterator that yields local nodes.

Parameters:
Name Type Description
keyspace String

Name of currently logged keyspace at Client level.

executionOptions ExecutionOptions | null

The information related to the execution of the request.

callback function

The function to be invoked with the error as first parameter and the host iterator as second parameter.

Source: