C# Class MongoDB.Driver.Internal.ShardedMongoServerProxy

Connects to a number of mongos' and distributes load based on ping times.
Inheritance: MultipleInstanceMongoServerProxy
Mostrar archivo Open project: CloudMetal/mongo-csharp-driver

Public Methods

Method Description
ShardedMongoServerProxy ( MongoServerSettings settings ) : System

Initializes a new instance of the ShardedMongoServerProxy class.

ShardedMongoServerProxy ( MongoServerSettings settings, IEnumerable instances, BlockingQueue stateChangedQueue, int connectionAttempt ) : System

Initializes a new instance of the ShardedMongoServerProxy class.

Protected Methods

Method Description
ChooseServerInstance ( ConnectedInstanceCollection connectedInstances, ReadPreference readPreference ) : MongoServerInstance

Chooses the server instance.

DetermineServerState ( MongoServerState currentState, IEnumerable instances ) : MongoServerState

Determines the state of the server.

IsValidInstance ( MongoServerInstance instance ) : bool

Determines whether the instance is a valid. If not, the instance is removed.

Method Details

ChooseServerInstance() protected method

Chooses the server instance.
protected ChooseServerInstance ( ConnectedInstanceCollection connectedInstances, ReadPreference readPreference ) : MongoServerInstance
connectedInstances ConnectedInstanceCollection The connected instances.
readPreference ReadPreference The read preference.
return MongoServerInstance

DetermineServerState() protected method

Determines the state of the server.
protected DetermineServerState ( MongoServerState currentState, IEnumerable instances ) : MongoServerState
currentState MongoServerState State of the current.
instances IEnumerable The instances.
return MongoServerState

IsValidInstance() protected method

Determines whether the instance is a valid. If not, the instance is removed.
protected IsValidInstance ( MongoServerInstance instance ) : bool
instance MongoServerInstance The instance.
return bool

ShardedMongoServerProxy() public method

Initializes a new instance of the ShardedMongoServerProxy class.
public ShardedMongoServerProxy ( MongoServerSettings settings ) : System
settings MongoServerSettings The settings.
return System

ShardedMongoServerProxy() public method

Initializes a new instance of the ShardedMongoServerProxy class.
public ShardedMongoServerProxy ( MongoServerSettings settings, IEnumerable instances, BlockingQueue stateChangedQueue, int connectionAttempt ) : System
settings MongoServerSettings The settings.
instances IEnumerable The instances.
stateChangedQueue BlockingQueue The state changed queue.
connectionAttempt int The connection attempt.
return System