public class Policy extends Object
Modifier and Type | Field and Description |
---|---|
ConsistencyLevel |
consistencyLevel
How replicas should be consulted in a read operation to provide the desired
consistency guarantee.
|
int |
maxRetries
Maximum number of retries before aborting the current transaction.
|
Priority |
priority
Priority of request relative to other transactions.
|
Replica |
replica
Send read commands to the node containing the key's partition replica type.
|
boolean |
sendKey
Send user defined key in addition to hash digest on both reads and writes.
|
int |
sleepBetweenRetries
Milliseconds to sleep between retries if a transaction fails and the
timeout was not exceeded.
|
int |
timeout
Total transaction timeout in milliseconds for both client and server.
|
int |
timeoutDelay
Delay milliseconds after transaction timeout before closing socket in async mode only.
|
public Priority priority
public ConsistencyLevel consistencyLevel
public Replica replica
Default to sending read commands to the node containing the key's master partition.
public int timeout
The timeout is also used as a socket timeout. Retries will not occur if the timeout limit has been reached. Default to no timeout (0).
public int timeoutDelay
This field delays the closing of the socket to give the transaction more time to complete in the hope that the socket can be reused. This is helpful when timeouts are aggressive and a certain percentage of timeouts is expected.
The user is still notified of the timeout in async mode at the original timeout value. The transaction's async timer is then reset to this delay and the transaction is allowed to continue. If the transactions succeeds within the delay, then the socket is placed back on the pool and the transaction response is discarded. Otherwise, the socket must be closed.
This field is ignored in sync mode because control must be returned back to user on timeout and there is no currently available thread pool to process the delay.
Default: 0 (no delay, connection closed on timeout)
public int maxRetries
This field is ignored in async mode. Async transactions only retry on invalid connections in the connection pool which is not bounded.
Default: 1
public int sleepBetweenRetries
This field is ignored in async mode.
Default: 500ms
public boolean sendKey
public Policy(Policy other)
public Policy()
Copyright © 2012–2016 Aerospike, Inc. All rights reserved.