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.client.message |
Low level messages to be sent to the MongoDB server.
|
com.allanbank.mongodb.client.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 |
AsyncMongoCollection.countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AsyncMongoCollection.countAsync(Callback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
AsyncMongoCollection.countAsync(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AsyncMongoCollection.countAsync(LambdaCallback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AsyncMongoCollection.countAsync(LambdaCallback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
AsyncMongoCollection.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 |
Count.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 |
Find.Builder.myReadPreference
The preference for which servers to use to retrieve the results.
|
protected ReadPreference |
Distinct.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
Text.Builder.myReadPreference
Deprecated.
The read preference to use.
|
protected ReadPreference |
GroupBy.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
MapReduce.Builder.myReadPreference
The read preference to use.
|
protected ReadPreference |
ParallelScan.Builder.myReadPreference
The preference for which servers to use to retrieve the results.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
Count.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 |
Find.getReadPreference()
Returns the preference for the servers to retrieve the results from.
|
ReadPreference |
Distinct.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
ReadPreference |
Text.getReadPreference()
Deprecated.
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. |
ReadPreference |
MapReduce.getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
ReadPreference |
ParallelScan.getReadPreference()
Returns the preference for the servers to retrieve the results from.
|
Modifier and Type | Method and Description |
---|---|
Count.Builder |
Count.Builder.readPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Find.Builder |
Find.Builder.readPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Distinct.Builder |
Distinct.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
Text.Builder |
Text.Builder.readPreference(ReadPreference readPreference)
Deprecated.
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. |
MapReduce.Builder |
MapReduce.Builder.readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
ParallelScan.Builder |
ParallelScan.Builder.readPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Count.Builder |
Count.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. |
Find.Builder |
Find.Builder.setReadPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Distinct.Builder |
Distinct.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Distinct command. |
Text.Builder |
Text.Builder.setReadPreference(ReadPreference readPreference)
Deprecated.
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. |
MapReduce.Builder |
MapReduce.Builder.setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
ParallelScan.Builder |
ParallelScan.Builder.setReadPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Document |
Find.toQueryRequest(boolean explain,
ReadPreference readPreference)
This method is not intended for applications to use.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
SerialClientImpl.getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
ReadPreference |
ClientImpl.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 |
MongoDatabaseImpl.getReadPreference()
Returns the read preference for queries from this
MongoDatabase
instance. |
ReadPreference |
Message.getReadPreference()
Provides the details on which servers are eligible to receive the
message.
|
ReadPreference |
AbstractMongoOperations.getReadPreference()
Returns the read preference to use when no read preference is specified
for the read operation.
|
protected ReadPreference |
AbstractMongoOperations.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 |
SynchronousMongoCollectionImpl.count(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
long |
SynchronousMongoCollectionImpl.count(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
AbstractAsyncMongoCollection.countAsync(Callback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AbstractAsyncMongoCollection.countAsync(Callback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
AbstractAsyncMongoCollection.countAsync(DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AbstractAsyncMongoCollection.countAsync(LambdaCallback<Long> results,
DocumentAssignable query,
ReadPreference readPreference)
Counts the set of documents matching the query document in the
collection.
|
void |
AbstractAsyncMongoCollection.countAsync(LambdaCallback<Long> results,
ReadPreference readPreference)
Counts the set of documents in the collection.
|
ListenableFuture<Long> |
AbstractAsyncMongoCollection.countAsync(ReadPreference readPreference)
Counts the set of documents in the collection.
|
void |
MongoDatabaseImpl.setReadPreference(ReadPreference readPreference)
Sets the value of the read preference for a queries from this
MongoDatabase instance. |
void |
AbstractMongoOperations.setReadPreference(ReadPreference readPreference)
Sets the read preference to use when no read preference is specified for
the read operation.
|
protected ReadPreference |
AbstractMongoOperations.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 |
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.
|
AbstractMessage(String databaseName,
String collectionName,
ReadPreference readPreference,
VersionRange versionRange)
Creates a new AbstractMessage.
|
AggregateCommand(Aggregate aggregation,
String databaseName,
String collectionName,
Document commandDocument,
ReadPreference readPreference,
VersionRange requiredServerVersion)
Create a new AggregateCommand.
|
Command(String databaseName,
String collectionName,
Document commandDocument,
Document routingDocument,
ReadPreference readPreference,
VersionRange requiredServerVersion)
Create a new Command.
|
Command(String databaseName,
String collectionName,
Document commandDocument,
ReadPreference readPreference)
Create a new Command.
|
Command(String databaseName,
String collectionName,
Document commandDocument,
ReadPreference readPreference,
VersionRange requiredServerVersion)
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.
|
ParallelScanCommand(ParallelScan command,
String databaseName,
String collectionName,
Document commandDocument,
ReadPreference readPreference)
Create a new ParallelScanCommand.
|
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<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.
|
protected List<Server> |
Cluster.findWritableCandidates(ReadPreference readPreference)
Returns the list of writable servers that match the read preference's
tags.
|
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.