ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Modules policies loadBalancing LoadBalancingPolicy

LoadBalancingPolicy¶

policies/loadBalancing~LoadBalancingPolicy()

Base class for Load Balancing Policies

Constructor¶

new LoadBalancingPolicy()

Source

policies/load-balancing.js, line 16

Methods¶

getDistance(host)

Returns the distance assigned by this policy to the provided host.

Parameters:
Name Type Description
host Host

Source

policies/load-balancing.js, line 33

getOptions()

Gets an associative array containing the policy options.

Source

policies/load-balancing.js, line 55

(package) getRustConfiguration() → {_rust.LoadBalancingConfig}

Source

policies/load-balancing.js, line 63

Returns:
Type
_rust.LoadBalancingConfig

init(client, hosts, callback)

Initializes the load balancing policy, called after the driver obtained the information of the cluster.

Parameters:
Name Type Description
client Client
hosts HostMap
callback function

Source

policies/load-balancing.js, line 24

newQueryPlan(keyspace, executionOptions, callback)

Returns an iterator with the hosts for a new query. Each new query will call this method. The first host in the result will then be used to perform the query.

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

policies/load-balancing.js, line 45

Was this page helpful?

PREVIOUS
LoadBalancingConfig
NEXT
RoundRobinPolicy
  • Create an issue
  • Edit this page

On this page

  • LoadBalancingPolicy
    • Constructor
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • main
    • main
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • concurrent
      • datastax
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metadata
        • Aggregate
        • ClientState
        • ColumnMetadata
        • Index
        • KeyspaceMetadata
        • MaterializedView
        • Metadata
        • SchemaFunction
        • Strategy
        • TableMetadata
        • UdtField
        • UserDefinedType
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • speculativeExecution
          • ConstantSpeculativeExecutionPolicy
          • NoSpeculativeExecutionPolicy
          • SpeculativeExecutionPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • Long
        • ResultSet
        • ResultStream
        • Row
        • TimeUuid
        • Vector
    • Classes
      • AddressResolver
      • ByteOrderedToken
      • Client
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • HashSet
      • Host
      • HostMap
      • LineString
      • Murmur3Token
      • Point
      • Polygon
      • PreparedInfo
      • RandomToken
      • SslOptions
      • Token
      • TokenRange
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 May 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2