public final class BatchPolicy extends Policy
Modifier and Type | Field and Description |
---|---|
boolean |
allowInline
Allow batch to be processed immediately in the server's receiving thread for in-memory
namespaces.
|
boolean |
allowInlineSSD
Allow batch to be processed immediately in the server's receiving thread for SSD
namespaces.
|
int |
maxConcurrentThreads
Maximum number of concurrent synchronous batch node request threads to server nodes.
|
boolean |
respondAllKeys
Should all batch keys be attempted regardless of errors.
|
boolean |
sendSetName
Deprecated.
|
compress, connectTimeout, failOnFilteredOut, filterExp, maxRetries, readModeAP, readModeSC, replica, sendKey, sleepBetweenRetries, socketTimeout, timeoutDelay, totalTimeout
Constructor and Description |
---|
BatchPolicy()
Default constructor.
|
BatchPolicy(BatchPolicy other)
Copy batch policy from another batch policy.
|
BatchPolicy(Policy other)
Copy batch policy from another policy.
|
Modifier and Type | Method and Description |
---|---|
static BatchPolicy |
ReadDefault()
Default batch read policy.
|
void |
setAllowInline(boolean allowInline) |
void |
setAllowInlineSSD(boolean allowInlineSSD) |
void |
setMaxConcurrentThreads(int maxConcurrentThreads) |
void |
setRespondAllKeys(boolean respondAllKeys) |
static BatchPolicy |
WriteDefault()
Default batch write policy.
|
equals, hashCode, setCompress, setConnectTimeout, setFailOnFilteredOut, setFilterExp, setMaxRetries, setReadModeAP, setReadModeSC, setReplica, setSendKey, setSleepBetweenRetries, setSocketTimeout, setTimeout, setTimeoutDelay, setTimeouts, setTotalTimeout
public int maxConcurrentThreads
The batch is split into requests for each node according to the node assignment of each batch key. The number of batch node requests is always less or equal to the cluster size.
If there are 16 batch node requests and maxConcurrentThreads is 8, then batch requests will be made for 8 nodes in parallel threads. When a request completes, a new request will be issued until all 16 requests are complete. If there are 4 batch node requests and maxConcurrentThreads is 8, then only 4 batch requests will be made for 4 nodes in parallel threads.
Values:
Default: 1
public boolean allowInline
For batch transactions with smaller sized records (<= 1K per record), inline processing will be significantly faster on in-memory namespaces.
Inline processing can introduce the possibility of unfairness because the server can process the entire batch before moving onto the next command.
Default: true
public boolean allowInlineSSD
Inline processing can introduce the possibility of unfairness because the server can process the entire batch before moving onto the next command.
Default: false
public boolean respondAllKeys
If true, every batch key is attempted regardless of previous key specific errors. Node specific errors such as timeouts stop keys to that node, but keys directed at other nodes will continue to be processed.
If false, the server will stop the batch to its node on most key specific errors.
The exceptions are ResultCode.KEY_NOT_FOUND_ERROR
and
ResultCode.FILTERED_OUT
which never stop the batch.
The client will stop the entire batch on node specific errors for sync commands
that are run in sequence (maxConcurrentThreads == 1). The client will not stop
the entire batch for async commands or sync commands run in parallel.
Server versions < 6.0 do not support this field and treat this value as false for key specific errors.
Default: true
@Deprecated public boolean sendSetName
Send set name field to server for every key in the batch for batch index protocol. This is necessary for batch writes and batch reads when authentication is enabled and security roles are defined on a per set basis.
Default: false
public BatchPolicy(BatchPolicy other)
public BatchPolicy(Policy other)
public BatchPolicy()
public static BatchPolicy ReadDefault()
public static BatchPolicy WriteDefault()
public void setMaxConcurrentThreads(int maxConcurrentThreads)
public void setAllowInline(boolean allowInline)
public void setAllowInlineSSD(boolean allowInlineSSD)
public void setRespondAllKeys(boolean respondAllKeys)
Copyright © 2012–2024 Aerospike, Inc. All rights reserved.