Package com.couchbase.client.java.kv
Class ScanType
java.lang.Object
com.couchbase.client.java.kv.ScanType
- Direct Known Subclasses:
PrefixScan,RangeScan,SamplingScan
Specifies which documents to include in a KV scan.
Create an instance using one of the static factory methods:
rangeScan(ScanTerm, ScanTerm)- All documents whose IDs are in a certain range.prefixScan(String)- All documents whose IDs have a certain prefix.samplingScan(long)- A random sample of documents.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract CoreScanTypebuild()static PrefixScanprefixScan(String documentIdPrefix) Specifies a range scan that includes all documents whose IDs start with the given prefix.static RangeScanSpecifies a range scan that includes all documents whose IDs are between twoScanTerms.static SamplingScansamplingScan(long limit) Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with a random seed.static SamplingScansamplingScan(long limit, long seed) Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with the specified seed.
-
Constructor Details
-
ScanType
public ScanType()
-
-
Method Details
-
rangeScan
Specifies a range scan that includes all documents whose IDs are between twoScanTerms.- Parameters:
from- the start of the range, or null for unboundedto- the end of the range, or null for unbounded- Returns:
- a newly created
RangeScanto be passed into the Collection API.
-
prefixScan
Specifies a range scan that includes all documents whose IDs start with the given prefix.- Returns:
- a newly created
RangeScanto be passed into the Collection API.
-
samplingScan
Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with a random seed.- Parameters:
limit- the number of documents to limit sampling to.- Returns:
- a newly created
RangeScanto be passed into the Collection API.
-
samplingScan
Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with the specified seed.- Parameters:
limit- the number of documents to limit sampling to.seed- seed for the random number generator that selects the documents. CAVEAT: Specifying the same seed does not guarantee the same documents are selected.- Returns:
- a newly created
RangeScanto be passed into the Collection API.
-
build
-