public final class PartitionFilter extends Object implements Serializable
If a previous scan/query returned all records specified by a PartitionFilter instance, a
future scan/query using the same PartitionFilter instance will only return new records added
after the last record read (in digest order) in each partition in the previous scan/query.
To reset the cursor of an existing PartitionFilter instance, call
setPartitions(PartitionStatus[]) with a null argument.
| Modifier and Type | Method and Description |
|---|---|
static PartitionFilter |
after(byte[] digest)
Return records after the digest in partition containing the digest.
|
static PartitionFilter |
after(Key key)
Return records after key's digest in partition containing the digest.
|
static PartitionFilter |
all()
Read all partitions.
|
int |
getBegin()
Return first partition id.
|
int |
getCount()
Return count of partitions.
|
byte[] |
getDigest()
Return resume after digest.
|
com.aerospike.client.query.PartitionStatus[] |
getPartitions()
Return status of each partition after scan termination.
|
static PartitionFilter |
id(int id)
Filter by partition id.
|
boolean |
isDone()
If using
ScanPolicy.maxRecords or
QueryPolicy.maxRecords,
did previous paginated scans with this partition filter instance return all records? |
boolean |
isRetry()
Indicates if the entire filter requires a retry after a failed attempt.
|
static PartitionFilter |
range(int begin,
int count)
Filter by partition range.
|
void |
setPartitions(com.aerospike.client.query.PartitionStatus[] partitions)
Set cursor status of all partitions.
|
public static PartitionFilter all()
public static PartitionFilter id(int id)
id - partition id (0 - 4095)public static PartitionFilter after(Key key)
key - return records after this key's digestpublic static PartitionFilter after(byte[] digest)
digest - return records after this digestpublic static PartitionFilter range(int begin, int count)
begin - start partition id (0 - 4095)count - number of partitionspublic int getBegin()
public int getCount()
public byte[] getDigest()
public com.aerospike.client.query.PartitionStatus[] getPartitions()
The partition status is accurate for sync/async scanPartitions and async queryPartitions.
The partition status is not accurate for
AerospikeClient.queryPartitions(com.aerospike.client.policy.QueryPolicy, Statement, PartitionFilter)
because the last digest received is set during query parsing, but the user may not have retrieved
that digest from the RecordSet yet.
public void setPartitions(com.aerospike.client.query.PartitionStatus[] partitions)
getPartitions() after a previous scan/query.
If a previous scan/query returned all records specified by a PartitionFilter instance, a future scan/query using the same PartitionFilter instance will only return new records added after the last record read (in digest order) in each partition in the previous scan/query. To reset the cursor of an existing PartitionFilter instance, call this method with a null argument.
public boolean isDone()
ScanPolicy.maxRecords or
QueryPolicy.maxRecords,
did previous paginated scans with this partition filter instance return all records?public boolean isRetry()
Copyright © 2012–2024 Aerospike, Inc. All rights reserved.