T
- the operations result type.AsyncReadOperation<List<AsyncBatchCursor<T>>>
, ReadOperation<List<BatchCursor<T>>>
public class ParallelCollectionScanOperation<T> extends Object implements AsyncReadOperation<List<AsyncBatchCursor<T>>>, ReadOperation<List<BatchCursor<T>>>
Note: As of MongoDB 2.6, this operation will work against a mongod, but not a mongos.
Constructor | Description |
---|---|
ParallelCollectionScanOperation(MongoNamespace namespace,
int numCursors,
Decoder<T> decoder) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
ParallelCollectionScanOperation<T> |
batchSize(int batchSize) |
The batch size to use for each cursor.
|
List<BatchCursor<T>> |
execute(ReadBinding binding) |
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<List<AsyncBatchCursor<T>>> callback) |
General execute which can return anything of type T
|
int |
getBatchSize() |
Gets the batch size to use for each cursor.
|
int |
getNumCursors() |
Gets the number of cursors requested.
|
ReadConcern |
getReadConcern() |
Gets the read concern
|
ParallelCollectionScanOperation<T> |
readConcern(ReadConcern readConcern) |
Sets the read concern
|
public ParallelCollectionScanOperation(MongoNamespace namespace, int numCursors, Decoder<T> decoder)
namespace
- the database and collection namespace for the operation.numCursors
- The maximum number of cursors to return. Must be between 1 and 10000, inclusive.decoder
- the decoder for the result documents.public int getNumCursors()
public int getBatchSize()
public ParallelCollectionScanOperation<T> batchSize(int batchSize)
batchSize
- the batch size, which must be greater than or equal to 0public ReadConcern getReadConcern()
public ParallelCollectionScanOperation<T> readConcern(ReadConcern readConcern)
readConcern
- the read concernpublic List<BatchCursor<T>> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<T>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<List<AsyncBatchCursor<T>>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<T>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed