Package com.mongodb
Class ParallelScanOptions.Builder
- java.lang.Object
-
- com.mongodb.ParallelScanOptions.Builder
-
- Enclosing class:
- ParallelScanOptions
@NotThreadSafe public static class ParallelScanOptions.Builder extends Object
A builder for the options
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParallelScanOptions.Builder
batchSize(int batchSize)
The batch size to use for each cursor.ParallelScanOptions
build()
Creates a ParallelScanOptions with the settings initialised in this builder.ParallelScanOptions.Builder
numCursors(int numCursors)
Set the requested number of cursors to iterate in parallel.ParallelScanOptions.Builder
readPreference(ReadPreference readPreference)
The read preference to use.
-
-
-
Method Detail
-
numCursors
public ParallelScanOptions.Builder numCursors(int numCursors)
Set the requested number of cursors to iterate in parallel. This is an upper bound and the server may provide fewer.- Parameters:
numCursors
- the number of cursors requested, which must be >= 1- Returns:
- this
-
batchSize
public ParallelScanOptions.Builder batchSize(int batchSize)
The batch size to use for each cursor.- Parameters:
batchSize
- the batch size, which must be >= 0- Returns:
- this
-
readPreference
public ParallelScanOptions.Builder readPreference(ReadPreference readPreference)
The read preference to use.- Parameters:
readPreference
- the read preference- Returns:
- this
-
build
public ParallelScanOptions build()
Creates a ParallelScanOptions with the settings initialised in this builder.- Returns:
- a new ParallelScanOptions.
-
-