Click or drag to resize
TokenAwarePolicy Class
A wrapper load balancing policy that adds token awareness to a child policy.

This policy encapsulates another policy. The resulting policy works in the following way:

  1. The Distance(Host) method is inherited from the child policy.
  2. The host yielded by the NewQueryPlan(String, IStatement) method will first return the Local replicas for the statement, based on the RoutingKey.
Inheritance Hierarchy
SystemObject
  DseTokenAwarePolicy

Namespace: Dse
Assembly: Dse (in Dse.dll) Version: 2.1.0
Syntax
C#
public class TokenAwarePolicy : ILoadBalancingPolicy

The TokenAwarePolicy type exposes the following members.

Constructors
  NameDescription
Public methodTokenAwarePolicy
Creates a new TokenAware policy that wraps the provided child load balancing policy.
Top
Methods
  NameDescription
Public methodDistance
Return the HostDistance for the provided host.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
Public methodNewQueryPlan
Returns the hosts to use for a new query.

The returned plan will first return replicas (whose HostDistance for the child policy is Local) for the query if it can determine them (i.e. mainly if IStatement.RoutingKey is not null). Following what it will return the plan of the child policy.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference