C# 클래스 CqlSharp.Network.BalancedConnectionStrategy

This implementation attempts to balance the connections over the cluster based on load. First it will try to reuse an existing connection. If no connections exist, or if all connection loads are larger than the newConnectionTreshold, a new connection is created at a node with an as low as possible load. If that fails (e.g. because the max amount of connections per node is reached), an attempt is made to select the least used connection from the least used node.
상속: IConnectionStrategy
파일 보기 프로젝트 열기: reuzel/CqlSharp 1 사용 예제들

공개 메소드들

메소드 설명
BalancedConnectionStrategy ( Ring nodes, CqlConnectionStringBuilder config ) : System.Linq

Initializes the strategy with the specified nodes and cluster configuration

GetOrCreateConnection ( ConnectionScope scope, PartitionKey partitionKey ) : Connection

Gets or creates connection to the cluster.

ReturnConnection ( Connection connection, ConnectionScope scope ) : void

Invoked when a connection is no longer in use by the application

메소드 상세

BalancedConnectionStrategy() 공개 메소드

Initializes the strategy with the specified nodes and cluster configuration
public BalancedConnectionStrategy ( Ring nodes, CqlConnectionStringBuilder config ) : System.Linq
nodes Ring The nodes.
config CqlConnectionStringBuilder The config.
리턴 System.Linq

GetOrCreateConnection() 공개 메소드

Gets or creates connection to the cluster.
public GetOrCreateConnection ( ConnectionScope scope, PartitionKey partitionKey ) : Connection
scope ConnectionScope
partitionKey PartitionKey
리턴 Connection

ReturnConnection() 공개 메소드

Invoked when a connection is no longer in use by the application
public ReturnConnection ( Connection connection, ConnectionScope scope ) : void
connection Connection The connection no longer used.
scope ConnectionScope
리턴 void