Name | Description | |
---|---|---|
![]() | ScanPolicy |
Default constructor.
Set maxRetries for scans on server versions >= 4.9. All other scans are not retried. The latest servers support retries on individual data partitions. This feature is useful when a cluster is migrating and partition(s) are missed or incomplete on the first scan attempt. If the first scan attempt misses 2 of 4096 partitions, then only those 2 partitions are retried in the next scan attempt from the last key digest received for each respective partition. A higher default maxRetries is used because it's wasteful to invalidate all scan results because a single partition was missed. |
![]() | ScanPolicy(ScanPolicy) |
Copy scan policy from another scan policy.
|
Name | Description | |
---|---|---|
![]() | SetTimeout |
Create a single timeout by setting socketTimeout and totalTimeout
to the same value.
(Inherited from Policy.) |
![]() | SetTimeouts |
Set socketTimeout and totalTimeout. If totalTimeout defined and
socketTimeout greater than totalTimeout, set socketTimeout to
totalTimeout.
(Inherited from Policy.) |
![]() | Validate |
Verify policies fields are within range.
|
Name | Description | |
---|---|---|
![]() | compress |
Use zlib compression on command buffers sent to the server and responses received
from the server when the buffer size is greater than 128 bytes.
(Inherited from Policy.)This option will increase cpu and memory usage (for extra compressed buffers), but decrease the size of data sent over the network. Default: false |
![]() | concurrentNodes |
Should scan requests be issued in parallel.
Default: true |
![]() | failOnClusterChange |
Terminate scan if cluster is in migration state.
Only used for server versions < 4.9.
Default: false |
![]() | failOnFilteredOut |
Throw exception if filterExp is defined and that filter evaluates
to false (transaction ignored). The AerospikeException
will contain result code .
(Inherited from Policy.)This field is not applicable to batch, scan or query commands. Default: false |
![]() | filterExp |
Optional expression filter. If filterExp exists and evaluates to false, the
transaction is ignored.
(Inherited from Policy.)Default: null |
![]() | includeBinData |
Should bin data be retrieved. If false, only record digests (and user keys
if stored on the server) are retrieved.
Default: true |
![]() | maxConcurrentNodes |
Maximum number of concurrent requests to server nodes at any point in time.
If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then scan requests
will be made to 8 nodes in parallel. When a scan completes, a new scan request will
be issued until all 16 nodes have been scanned.
This field is only relevant when concurrentNodes is true. Default: 0 (issue requests to all server nodes in parallel) |
![]() | maxRecords |
Approximate number of records to return to client. This number is divided by the
number of nodes involved in the scan. The actual number of records returned
may be less than maxRecords if node record counts are small and unbalanced across
nodes.
This field is supported on server versions >= 4.9. Default: 0 (do not limit record count) |
![]() | maxRetries |
Maximum number of retries before aborting the current transaction.
The initial attempt is not counted as a retry.
(Inherited from Policy.)If maxRetries is exceeded, the transaction will abort with AerospikeException Timeout. WARNING: Database writes that are not idempotent (such as Add()) should not be retried because the write operation may be performed multiple times if the client timed out previous transaction attempts. It's important to use a distinct WritePolicy for non-idempotent writes which sets maxRetries = 0; Default for read: 2 (initial attempt + 2 retries = 3 attempts) Default for write: 0 (no retries) Default for partition scan or query with null filter: 5 (6 attempts. See ScanPolicy comments.) No default for legacy scan/query. No retries are allowed for these commands. |
![]() | priority |
Priority of request relative to other transactions.
Only used for scans on server versions < 4.9.
(Inherited from Policy.)Priority is obsolete and will eventually be removed. Use recordsPerSecond instead of priority. |
![]() | readModeAP |
Read policy for AP (availability) namespaces.
(Inherited from Policy.)Default: ONE |
![]() | readModeSC |
Read policy for SC (strong consistency) namespaces.
(Inherited from Policy.)Default: SESSION |
![]() | recordsPerSecond |
Limit returned records per second (rps) rate for each server.
Do not apply rps limit if recordsPerSecond is zero.
Default: 0 |
![]() | replica |
Replica algorithm used to determine the target node for a single record command.
Scan and query are not affected by replica algorithms.
(Inherited from Policy.)Default: SEQUENCE |
![]() | scanPercent |
Percent of data to scan. Valid integer range is 1 to 100.
This field is supported on server versions < 4.9. Server versions >= 4.9 might allow scanPercent, but not in conjunction with maxRecords. scanPercent is eventually slated for removal. Default: 100 |
![]() | sendKey |
Send user defined key in addition to hash digest on both reads and writes.
If the key is sent on a write, the key will be stored with the record on
the server.
(Inherited from Policy.)Default: false (do not send the user defined key) |
![]() | sleepBetweenRetries |
Milliseconds to sleep between retries. Enter zero to skip sleep.
This field is ignored when maxRetries is zero.
This field is also ignored in async mode.
(Inherited from Policy.)The sleep only occurs on connection errors and server timeouts which suggest a node is down and the cluster is reforming. The sleep does not occur when the client's socketTimeout expires. Reads do not have to sleep when a node goes down because the cluster does not shut out reads during cluster reformation. The default for reads is zero. The default for writes is also zero because writes are not retried by default. Writes need to wait for the cluster to reform when a node goes down. Immediate write retries on node failure have been shown to consistently result in errors. If maxRetries is greater than zero on a write, then sleepBetweenRetries should be set high enough to allow the cluster to reform (>= 500ms). Default: 0 (do not sleep between retries) |
![]() | socketTimeout |
Socket idle timeout in milliseconds when processing a database command.
(Inherited from Policy.)If socketTimeout is zero and totalTimeout is non-zero, then socketTimeout will be set to totalTimeout. If both socketTimeout and totalTimeout are non-zero and socketTimeout > totalTimeout, then socketTimeout will be set to totalTimeout. If both socketTimeout and totalTimeout are zero, then there will be no socket idle limit. If socketTimeout is not zero and the socket has been idle for at least socketTimeout, both maxRetries and totalTimeout are checked. If maxRetries and totalTimeout are not exceeded, the transaction is retried. For synchronous methods, socketTimeout is the socket SendTimeout and ReceiveTimeout. For asynchronous methods, the socketTimeout is implemented using the AsyncTimeoutQueue and socketTimeout is only used if totalTimeout is not defined. Default: 30000ms |
![]() | totalTimeout |
Total transaction timeout in milliseconds.
(Inherited from Policy.)The totalTimeout is tracked on the client and sent to the server along with the transaction in the wire protocol. The client will most likely timeout first, but the server also has the capability to timeout the transaction. If totalTimeout is not zero and totalTimeout is reached before the transaction completes, the transaction will abort with AerospikeException Timeout. If totalTimeout is zero, there will be no total time limit. Default: 0 (no time limit) |