Package | Description |
---|---|
com.allanbank.mongodb |
Provides a Java driver for the MongoDB document store that allows asynchronous invocation of requests.
|
com.allanbank.mongodb.builder |
Provides domain classes and builders for queries and the common MongoDB commands.
|
com.allanbank.mongodb.client |
Provides implementations of the main client interfaces and classes to translate the
Reply (s) from the server. |
com.allanbank.mongodb.connection |
Provides interfaces for managing connections to different MongoDB server configurations.
|
com.allanbank.mongodb.connection.message |
Low level messages to be sent to the MongoDB server.
|
com.allanbank.mongodb.connection.state |
Support for tracking the state of a set of MongoDB servers.
|
Modifier and Type | Field and Description |
---|---|
static ReadPreference |
ReadPreference.CLOSEST
ReadPreference to read from the closest/ReadPreference.Mode.NEAREST
primary of secondary server. |
static ReadPreference |
ReadPreference.PREFER_PRIMARY
ReadPreference to prefer reading from the primary but to fallback
to a secondary if the primary is not available. |
static ReadPreference |
ReadPreference.PREFER_SECONDARY
ReadPreference to prefer reading from a secondary but to
'fallback' to a primary if a secondary is not available. |
static ReadPreference |
ReadPreference.PRIMARY
The default
ReadPreference to read from the primary only. |
static ReadPreference |
ReadPreference.SECONDARY
ReadPreference to read only from a secondary but using any
secondary. |
Modifier and Type | Method and Description |
---|---|
static ReadPreference |
ReadPreference.closest(DocumentAssignable... tagMatchDocuments)
Creates a
ReadPreference to read from the closest/
ReadPreference.Mode.NEAREST primary of secondary server. |
ReadPreference |
MongoClientConfiguration.getDefaultReadPreference()
Returns the default read preference for a query.
|
ReadPreference |
MongoDatabase.getReadPreference()
Returns the read preference for queries from this
MongoDatabase
instance. |
ReadPreference |
MongoCollection.getReadPreference()
Returns the read preference for queries from this
MongoCollection
instance. |
static ReadPreference |
ReadPreference.preferPrimary(DocumentAssignable... tagMatchDocuments)
Creates a
ReadPreference to prefer reading from the primary but
to fallback to a secondary if the primary is not available. |
static ReadPreference |
ReadPreference.preferSecondary(DocumentAssignable... tagMatchDocuments)
Creates a
ReadPreference to prefer reading from a secondary but
to 'fallback' to a primary if a secondary is not available. |
static ReadPreference |
ReadPreference.primary()
Returns the default
ReadPreference to read from the primary only:
PRIMARY . |
static ReadPreference |
ReadPreference.secondary(DocumentAssignable... tagMatchDocuments)
Creates a
ReadPreference to read only from a secondary. |
static ReadPreference |
ReadPreference.server(String address)
Creates a
ReadPreference to read only from a specific server. |
Modifier and Type | Method and Description |
---|---|
long |
MongoCollection.count(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
long |
MongoCollection.count(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
MongoCollection.countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
MongoCollection.countAsync(Callback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
Future<Long> |
MongoCollection.countAsync(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
Future<Long> |
MongoCollection.countAsync(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
MongoClientConfiguration.setDefaultReadPreference(ReadPreference defaultReadPreference)
Sets the value of the default read preference for a query.
|
void |
MongoDatabase.setReadPreference(ReadPreference readPreference)
Sets the value of the read preference for a queries from this
MongoDatabase instance. |
void |
MongoCollection.setReadPreference(ReadPreference readPreference)
Sets the value of the read preference for a queries from this
MongoCollection instance. |
Modifier and Type | Field and Description |
---|---|
protected ReadPreference |
Distinct.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
Find.Builder.myReadPreference
The preference for which servers to use to retrieve the results.
|
protected ReadPreference |
Aggregate.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
MapReduce.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
Text.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
GroupBy.Builder.myReadPreference
The read preference to use.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
Distinct.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
ReadPreference |
Find.getReadPreference()
Returns the preference for the servers to retrieve the results from.
|
ReadPreference |
Aggregate.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the aggregation. |
ReadPreference |
MapReduce.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
ReadPreference |
Text.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the Text command. |
ReadPreference |
GroupBy.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the GroupBy command. |
Modifier and Type | Method and Description |
---|---|
Distinct.Builder |
Distinct.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
Find.Builder |
Find.Builder.readPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
MapReduce.Builder |
MapReduce.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
Text.Builder |
Text.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Text command. |
GroupBy.Builder |
GroupBy.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the GroupBy command. |
Distinct.Builder |
Distinct.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
Find.Builder |
Find.Builder.setReadPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Aggregate.Builder |
Aggregate.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the aggregation. |
MapReduce.Builder |
MapReduce.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
Text.Builder |
Text.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Text command. |
GroupBy.Builder |
GroupBy.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the GroupBy command. |
Document |
Find.toQueryRequest(boolean explain,
ReadPreference readPreference)
This method is not intended for applications to use.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
ClientImpl.getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
ReadPreference |
SerialClientImpl.getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
ReadPreference |
Client.getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
ReadPreference |
MongoIteratorImpl.getReadPerference()
Returns the iterator's read preference which points to the original
server performing the query.
|
ReadPreference |
AbstractMongoCollection.getReadPreference()
Returns the read preference for queries from this
MongoCollection
instance. |
ReadPreference |
MongoDatabaseImpl.getReadPreference()
Returns the read preference for queries from this
MongoDatabase
instance. |
protected ReadPreference |
MongoCollectionImpl.updateReadPreference(DocumentBuilder builder,
ReadPreference commandReadPreference,
boolean createQueryElement)
Determines the
ReadPreference to be used based on the command's
ReadPreference or the collection's if the command's
ReadPreference is null . |
Modifier and Type | Method and Description |
---|---|
long |
AbstractMongoCollection.count(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
long |
AbstractMongoCollection.count(ReadPreference readPreference)
Counts the set of documents in the collection.
|
abstract void |
AbstractMongoCollection.countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
MongoCollectionImpl.countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AbstractMongoCollection.countAsync(Callback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
Future<Long> |
AbstractMongoCollection.countAsync(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
Future<Long> |
AbstractMongoCollection.countAsync(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
AbstractMongoCollection.setReadPreference(ReadPreference readPreference)
Sets the value of the read preference for a queries from this
MongoCollection instance. |
void |
MongoDatabaseImpl.setReadPreference(ReadPreference readPreference)
Sets the value of the read preference for a queries from this
MongoDatabase instance. |
protected ReadPreference |
MongoCollectionImpl.updateReadPreference(DocumentBuilder builder,
ReadPreference commandReadPreference,
boolean createQueryElement)
Determines the
ReadPreference to be used based on the command's
ReadPreference or the collection's if the command's
ReadPreference is null . |
Modifier and Type | Method and Description |
---|---|
ReadPreference |
Message.getReadPreference()
Provides the details on which servers are eligible to receive the
message.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
AbstractMessage.getReadPreference()
Provides the details on which servers are eligible to receive the
message.
|
Constructor and Description |
---|
AbstractMessage(String databaseName,
String collectionName,
ReadPreference readPreference)
Create a new AbstractMessage.
|
Command(String databaseName,
Document commandDocument,
ReadPreference readPreference)
Create a new Command.
|
GetMore(String databaseName,
String collectionName,
long cursorId,
int numberToReturn,
ReadPreference readPreference)
Creates a new GetMore.
|
KillCursors(long[] cursorIds,
ReadPreference readPreference)
Creates a new KillCursors.
|
Query(String databaseName,
String collectionName,
Document query,
Document returnFields,
int batchSize,
int limit,
int numberToSkip,
boolean tailable,
ReadPreference readPreference,
boolean noCursorTimeout,
boolean awaitData,
boolean exhaust,
boolean partial)
Creates a new Query.
|
Modifier and Type | Method and Description |
---|---|
protected List<ServerState> |
ClusterState.findCandidateServer(ReadPreference readPreference)
Finds the candidate server, if known.
|
List<ServerState> |
ClusterState.findCandidateServers(ReadPreference readPreference)
Returns the set of servers that can be used based on the provided
ReadPreference . |
protected List<ServerState> |
ClusterState.findNearestCandidates(ReadPreference readPreference)
Returns the list of servers that match the read preference's tags.
|
protected List<ServerState> |
ClusterState.findNonWritableCandidates(ReadPreference readPreference)
Returns the list of non-writable servers that match the read preference's
tags.
|
protected List<ServerState> |
ClusterState.findWritableCandidates(ReadPreference readPreference)
Returns the list of writable servers that match the read preference's
tags.
|
Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.