@Stability.Volatile public abstract class ScanType extends Object
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 and Description |
---|
ScanType() |
Modifier and Type | Method and Description |
---|---|
abstract com.couchbase.client.core.kv.CoreScanType |
build() |
static PrefixScan |
prefixScan(String documentIdPrefix)
Specifies a range scan that includes all documents whose IDs start with the given prefix.
|
static RangeScan |
rangeScan(ScanTerm from,
ScanTerm to)
Specifies a range scan that includes all documents whose IDs are between two
ScanTerms . |
static SamplingScan |
samplingScan(long limit)
Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with a random seed.
|
static SamplingScan |
samplingScan(long limit,
long seed)
Creates a new KV sampling scan, which randomly selects documents up until the configured limit, with the specified seed.
|
public static RangeScan rangeScan(@Nullable ScanTerm from, @Nullable ScanTerm to)
ScanTerms
.from
- the start of the range, or null for unboundedto
- the end of the range, or null for unboundedRangeScan
to be passed into the Collection API.public static PrefixScan prefixScan(String documentIdPrefix)
RangeScan
to be passed into the Collection API.public static SamplingScan samplingScan(long limit)
limit
- the number of documents to limit sampling to.RangeScan
to be passed into the Collection API.public static SamplingScan samplingScan(long limit, long seed)
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.RangeScan
to be passed into the Collection API.public abstract com.couchbase.client.core.kv.CoreScanType build()
Copyright © 2024 Couchbase, Inc.. All rights reserved.