Package com.couchbase.client.java.kv
Class ScanOptions
- java.lang.Object
-
- com.couchbase.client.java.CommonOptions<ScanOptions>
-
- com.couchbase.client.java.kv.ScanOptions
-
@Volatile public class ScanOptions extends CommonOptions<ScanOptions>
Allows to customize the various range and sampling scan options.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ScanOptions.Built
-
Nested classes/interfaces inherited from class com.couchbase.client.java.CommonOptions
CommonOptions.BuiltCommonOptions
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ScanOptions
batchByteLimit(int batchByteLimit)
Allows to limit the maximum amount of bytes that are sent from the server to the client on each partition batch.ScanOptions
batchItemLimit(int batchItemLimit)
Allows to limit the maximum amount of documents that are sent from the server to the client on each partition batch.ScanOptions.Built
build()
ScanOptions
consistentWith(MutationState mutationState)
ScanOptions
idsOnly(boolean idsOnly)
If set to true, the content of the document is not included in the results.static ScanOptions
scanOptions()
ScanOptions
sort(ScanSort sort)
Allows to configure sorting of the scan output.ScanOptions
transcoder(Transcoder transcoder)
Allows to specify a custom transcoder that is used to decode the content of the result.-
Methods inherited from class com.couchbase.client.java.CommonOptions
clientContext, parentSpan, retryStrategy, self, timeout
-
-
-
-
Method Detail
-
scanOptions
public static ScanOptions scanOptions()
-
idsOnly
public ScanOptions idsOnly(boolean idsOnly)
If set to true, the content of the document is not included in the results.- Parameters:
idsOnly
- True means document content and metadata are excluded from result; default is false.- Returns:
- the
ScanOptions
to allow method chaining.
-
sort
public ScanOptions sort(ScanSort sort)
Allows to configure sorting of the scan output.- Parameters:
sort
- the sorting type to use.- Returns:
- the
ScanOptions
to allow method chaining.
-
transcoder
public ScanOptions transcoder(Transcoder transcoder)
Allows to specify a custom transcoder that is used to decode the content of the result.- Parameters:
transcoder
- the custom transcoder that should be used for decoding.- Returns:
- the
ScanOptions
to allow method chaining.
-
consistentWith
public ScanOptions consistentWith(MutationState mutationState)
-
batchByteLimit
public ScanOptions batchByteLimit(int batchByteLimit)
Allows to limit the maximum amount of bytes that are sent from the server to the client on each partition batch.This option:
- will be applied to each partition stream individually, not to the operation as a whole.
- only acts as a target the server aims to satisfy, not a hard limit.
Also, the server will always send the document body, even if the configured byte limit is smaller. So as an example if a batchByteLimit of 1MB (1_000_000) is set and the document body size is 5MB it will still be sent to the client as a whole and not cut off in between.
If both this option and
batchItemLimit(int)
are set, both will be sent to the server and the smaller one will trigger first.- Parameters:
batchByteLimit
- the byte limit to set per stream, defaults to 15000 (15k).- Returns:
- the
ScanOptions
to allow method chaining.
-
batchItemLimit
public ScanOptions batchItemLimit(int batchItemLimit)
Allows to limit the maximum amount of documents that are sent from the server to the client on each partition batch.This option:
- will be applied to each partition stream individually, not to the operation as a whole.
If both this option and
batchByteLimit(int)
are set, both will be sent to the server and the smaller one will trigger first.- Parameters:
batchItemLimit
- the item limit to set per stream, defaults to 50.- Returns:
- the
ScanOptions
to allow method chaining.
-
build
@Internal public ScanOptions.Built build()
-
-