Package com.couchbase.client.java.kv
Class ScanOptions
Allows to customize the various range and sampling scan options.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.couchbase.client.java.CommonOptions
CommonOptions.BuiltCommonOptions
-
Method Summary
Modifier and TypeMethodDescriptionbatchByteLimit
(int batchByteLimit) Allows to limit the maximum amount of bytes that are sent from the server to the client on each partition batch.batchItemLimit
(int batchItemLimit) Allows to limit the maximum amount of documents that are sent from the server to the client on each partition batch.build()
consistentWith
(MutationState mutationState) idsOnly
(boolean idsOnly) If set to true, the content of the document is not included in the results.static 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 Details
-
scanOptions
-
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.
-
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
-
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
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
-