T
- the operations result type.public class ParallelCollectionScanOperation<T> extends java.lang.Object implements AsyncReadOperation<java.util.List<AsyncBatchCursor<T>>>, ReadOperation<java.util.List<BatchCursor<T>>>
Note: As of MongoDB 2.6, this operation will work against a mongod, but not a mongos.
Constructor and Description |
---|
ParallelCollectionScanOperation(MongoNamespace namespace,
int numCursors,
Decoder<T> decoder)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
ParallelCollectionScanOperation<T> |
batchSize(int batchSize)
The batch size to use for each cursor.
|
java.util.List<BatchCursor<T>> |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<java.util.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 java.util.List<BatchCursor<T>> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<java.util.List<BatchCursor<T>>>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<java.util.List<AsyncBatchCursor<T>>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<java.util.List<AsyncBatchCursor<T>>>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed