Class PartitionFilter
- All Implemented Interfaces:
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic PartitionFilterafter(byte[] digest) Return records after the digest in the partition containing the digest.static PartitionFilterReturn records after the key's digest in the partition containing the digest.static PartitionFilterall()Read all partitions.intgetBegin()Return first partition id.intgetCount()Return count of partitions.byte[]Return resume after digest.com.aerospike.client.query.PartitionStatus[]Return status of each partition after scan termination.static PartitionFilterid(int id) Filter by partition id.booleanisDone()If usingScanPolicy.maxRecordsorQueryPolicy.maxRecords, did previous paginated scans with this partition filter instance return all records?booleanisRetry()Indicates if the entire filter requires a retry after a failed attempt.static PartitionFilterrange(int begin, int count) Filter by partition range.voidsetPartitions(com.aerospike.client.query.PartitionStatus[] partitions) Set cursor status of all partitions.
-
Method Details
-
all
Read all partitions. -
id
Filter by partition id.- Parameters:
id- partition id (0 - 4095)
-
after
Return records after the key's digest in the partition containing the digest. Records in all other partitions are not included. The digest is used to determine order and this is not the same as userKey order.This method only works for scan or query with null filter (primary index query). This method does not work for a secondary index query because the digest alone is not sufficient to determine a cursor in a secondary index query.
- Parameters:
key- return records after this key's digest
-
after
Return records after the digest in the partition containing the digest. Records in all other partitions are not included. The digest is used to determine order and this is not the same as userKey order.This method only works for scan or query with null filter (primary index query). This method does not work for a secondary index query because the digest alone is not sufficient to determine a cursor in a secondary index query.
- Parameters:
digest- return records after this digest
-
range
Filter by partition range.- Parameters:
begin- start partition id (0 - 4095)count- number of partitions
-
getBegin
public int getBegin()Return first partition id. -
getCount
public int getCount()Return count of partitions. -
getDigest
public byte[] getDigest()Return resume after digest. -
getPartitions
public com.aerospike.client.query.PartitionStatus[] getPartitions()Return status of each partition after scan termination. Useful for external retry of partially completed scans at a later time.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. -
setPartitions
public void setPartitions(com.aerospike.client.query.PartitionStatus[] partitions) Set cursor status of all partitions. The cursor contains the last record read for each partition and is usually obtained fromgetPartitions()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.
-
isDone
public boolean isDone()If usingScanPolicy.maxRecordsorQueryPolicy.maxRecords, did previous paginated scans with this partition filter instance return all records? -
isRetry
public boolean isRetry()Indicates if the entire filter requires a retry after a failed attempt.
-