Package | Description |
---|---|
com.allanbank.mongodb.client.connection.auth |
Wraps a connection and ensures that all requests are properly authenticated.
|
com.allanbank.mongodb.client.connection.proxy |
Support for connection that delegate to a lower level connection.
|
com.allanbank.mongodb.client.connection.rs |
Support for connections to Replica Sets.
|
com.allanbank.mongodb.client.connection.sharded |
Support for connections to Sharded Configurations.
|
com.allanbank.mongodb.client.connection.socket |
Low level socket connection to a single MongoDB server.
|
com.allanbank.mongodb.client.state |
Support for tracking the state of a set of MongoDB servers.
|
Modifier and Type | Method and Description |
---|---|
AuthenticatingConnection |
AuthenticationConnectionFactory.connect(Server server,
MongoClientConfiguration config)
Creates a connection to the address provided.
|
Modifier and Type | Method and Description |
---|---|
Connection |
ProxiedConnectionFactory.connect(Server server,
MongoClientConfiguration config)
Creates a connection to the address provided.
|
Modifier and Type | Method and Description |
---|---|
protected ConnectionInfo<Server> |
ReplicaSetReconnectStrategy.checkForReply(Cluster state,
Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
long deadline)
Checks for a reply from a server.
|
protected List<Server> |
ReplicaSetConnection.findPotentialKeys(Message message1,
Message message2)
Locates the set of servers that can be used to send the specified
messages.
|
protected List<Server> |
ReplicaSetConnectionFactory.locatePrimary()
Locates the primary server in the cluster.
|
protected ConnectionInfo<Server> |
ReplicaSetConnection.reconnectMain()
Creates a connection back to the main server for this connection.
|
ConnectionInfo<Server> |
ReplicaSetReconnectStrategy.reconnectPrimary()
Overridden to search for the primary server in the replica set.
|
Modifier and Type | Method and Description |
---|---|
protected String |
ReplicaSetReconnectStrategy.checkReply(Future<Reply> replyFuture,
Map<Server,Connection> connections,
Server server,
long deadline)
Extracts who the server thinks is the primary from the reply.
|
protected Connection |
ReplicaSetConnection.connect(Server server)
Attempts to create a connection to the server, catching any exceptions
thrown.
|
protected boolean |
ReplicaSetConnectionFactory.isWritable(Server server,
Connection connection)
Determines if the connection is to the primary member of the cluster.
|
protected Future<Reply> |
ReplicaSetReconnectStrategy.sendIsPrimary(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server server,
boolean isPrimary)
Sends a command to the server to return what it thinks the state of the
cluster is.
|
protected boolean |
ReplicaSetReconnectStrategy.verifyPutative(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server putativePrimary,
long deadline)
Tries to verify that the suspected primary server is in fact the primary
server by asking it directly and synchronously.
|
Modifier and Type | Method and Description |
---|---|
protected ConnectionInfo<Server> |
ReplicaSetReconnectStrategy.checkForReply(Cluster state,
Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
long deadline)
Checks for a reply from a server.
|
protected ConnectionInfo<Server> |
ReplicaSetReconnectStrategy.checkForReply(Cluster state,
Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
long deadline)
Checks for a reply from a server.
|
protected String |
ReplicaSetReconnectStrategy.checkReply(Future<Reply> replyFuture,
Map<Server,Connection> connections,
Server server,
long deadline)
Extracts who the server thinks is the primary from the reply.
|
protected Future<Reply> |
ReplicaSetReconnectStrategy.sendIsPrimary(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server server,
boolean isPrimary)
Sends a command to the server to return what it thinks the state of the
cluster is.
|
protected Future<Reply> |
ReplicaSetReconnectStrategy.sendIsPrimary(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server server,
boolean isPrimary)
Sends a command to the server to return what it thinks the state of the
cluster is.
|
protected boolean |
ReplicaSetReconnectStrategy.verifyPutative(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server putativePrimary,
long deadline)
Tries to verify that the suspected primary server is in fact the primary
server by asking it directly and synchronously.
|
protected boolean |
ReplicaSetReconnectStrategy.verifyPutative(Map<Server,Future<Reply>> answers,
Map<Server,Connection> connections,
Server putativePrimary,
long deadline)
Tries to verify that the suspected primary server is in fact the primary
server by asking it directly and synchronously.
|
Constructor and Description |
---|
ReplicaSetConnection(Connection proxiedConnection,
Server server,
Cluster cluster,
ProxiedConnectionFactory factory,
MongoClientConfiguration config,
ReplicaSetReconnectStrategy strategy)
Creates a new
ReplicaSetConnection . |
Modifier and Type | Method and Description |
---|---|
protected List<Server> |
ShardedConnection.findPotentialKeys(Message message1,
Message message2)
Locates the set of servers that can be used to send the specified
messages.
|
protected ConnectionInfo<Server> |
ShardedConnection.reconnectMain()
Creates a connection back to the main server for this connection.
|
Modifier and Type | Method and Description |
---|---|
protected Connection |
ShardedConnection.connect(Server server)
Attempts to create a connection to the server, catching any exceptions
thrown.
|
protected Connection |
ShardedConnection.connection(Server server)
Returns the cached connection for the specified key.
|
protected Connection |
ShardedConnectionFactory.wrap(Connection primaryConn,
Server server)
Wraps the connection in a shard-aware connection.
|
Constructor and Description |
---|
ShardedConnection(Connection proxiedConnection,
Server server,
Cluster cluster,
ServerSelector selector,
ProxiedConnectionFactory factory,
MongoClientConfiguration config)
Creates a new
ShardedConnection . |
Modifier and Type | Field and Description |
---|---|
protected Server |
AbstractSocketConnection.myServer
The open socket.
|
Modifier and Type | Method and Description |
---|---|
Connection |
SocketConnectionFactory.connect(Server server,
MongoClientConfiguration config)
Creates a connection to the address provided.
|
Constructor and Description |
---|
AbstractSocketConnection(Server server,
MongoClientConfiguration config,
StringEncoderCache encoderCache,
StringDecoderCache decoderCache)
Creates a new AbstractSocketConnection.
|
SocketConnection(Server server,
MongoClientConfiguration config)
Creates a new SocketConnection to a MongoDB server.
|
SocketConnection(Server server,
MongoClientConfiguration config,
StringEncoderCache encoderCache,
StringDecoderCache decoderCache,
ThreadLocal<Reference<BufferingBsonOutputStream>> buffers)
Creates a new SocketConnection to a MongoDB server.
|
TwoThreadSocketConnection(Server server,
MongoClientConfiguration config)
Creates a new SocketConnection to a MongoDB server.
|
TwoThreadSocketConnection(Server server,
MongoClientConfiguration config,
StringEncoderCache encoderCache,
StringDecoderCache decoderCache)
Creates a new SocketConnection to a MongoDB server.
|
Modifier and Type | Field and Description |
---|---|
static Comparator<Server> |
ServerLatencyComparator.COMPARATOR
A singleton instance of the comparator.
|
protected ConcurrentMap<String,Server> |
Cluster.myServers
The complete list of servers.
|
Modifier and Type | Method and Description |
---|---|
Server |
Cluster.add(InetSocketAddress address)
|
Server |
Cluster.add(String address)
|
Server |
Cluster.get(String address)
Returns the server state for the address provided.
|
Modifier and Type | Method and Description |
---|---|
protected List<Server> |
Cluster.findCandidateServer(ReadPreference readPreference)
Finds the candidate server, if known.
|
List<Server> |
Cluster.findCandidateServers(ReadPreference readPreference)
Returns the set of servers that can be used based on the provided
ReadPreference . |
protected List<Server> |
Cluster.findNearestCandidates(ReadPreference readPreference)
Returns the list of servers that match the read preference's tags.
|
protected List<Server> |
Cluster.findNonWritableCandidates(ReadPreference readPreference)
Returns the list of non-writable servers that match the read preference's
tags.
|
List<Server> |
Cluster.findServers(Message message1,
Message message2)
Locates the set of servers that can be used to send the specified
messages.
|
protected List<Server> |
Cluster.findWritableCandidates(ReadPreference readPreference)
Returns the list of writable servers that match the read preference's
tags.
|
List<Server> |
Cluster.getNonWritableServers()
Returns a copy of the list of non-writable servers.
|
List<Server> |
Cluster.getServers()
Returns a copy of the list of servers.
|
List<Server> |
Cluster.getWritableServers()
Returns a copy of the list of writable servers.
|
List<Server> |
ServerSelector.pickServers()
Picks a server to try and connect to.
|
List<Server> |
LatencyServerSelector.pickServers()
Picks a server to try and connect to.
|
Modifier and Type | Method and Description |
---|---|
int |
ServerLatencyComparator.compare(Server o1,
Server o2) |
protected boolean |
AbstractReconnectStrategy.isConnected(Server server,
Connection connection)
Pings the server to verify that the connection is active.
|
static boolean |
ClusterPinger.ping(Server server,
Connection conn)
Pings the server and suppresses all exceptions.
|
boolean |
ClusterPinger.Pinger.ping(Server server,
Connection conn)
Pings the server and suppresses all exceptions.
|
Future<Reply> |
ClusterPinger.Pinger.pingAsync(ClusterType type,
Server server,
Connection conn)
Pings the server and suppresses all exceptions.
|
void |
Cluster.remove(Server server)
Removes the specified server from the cluster.
|
Modifier and Type | Method and Description |
---|---|
protected double[] |
Cluster.cdf(List<Server> servers)
Computes a relative CDF (cumulative distribution function) for the
servers based on the latency from the client.
|
protected void |
Cluster.sort(List<Server> servers)
Sorts the servers based on the latency from the client.
|
Constructor and Description |
---|
ServerUpdateCallback(Server server)
Creates a new ServerUpdateCallback.
|
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.