public class ClientPolicy extends Object
Modifier and Type | Field and Description |
---|---|
AuthMode |
authMode
Authentication mode used when user/password is defined.
|
BatchPolicy |
batchPolicyDefault
Default batch policy that is used when batch command's policy is null.
|
String |
clusterName
Expected cluster name.
|
int |
connPoolsPerNode
Number of synchronous connection pools used for each node.
|
EventLoops |
eventLoops
Optional event loops to use in asynchronous commands.
|
boolean |
failIfNotConnected
Throw exception if all seed connections fail on cluster instantiation.
|
boolean |
forceSingleNode
For testing purposes only.
|
InfoPolicy |
infoPolicyDefault
Default info policy that is used when info command's policy is null.
|
Map<String,String> |
ipMap
A IP translation table is used in cases where different clients use different server
IP addresses.
|
int |
loginTimeout
Login timeout in milliseconds.
|
int |
maxConnsPerNode
Maximum number of connections allowed per server node.
|
int |
maxSocketIdle
Maximum socket idle in seconds.
|
String |
password
Password authentication to cluster.
|
QueryPolicy |
queryPolicyDefault
Default query policy that is used when query command's policy is null.
|
Policy |
readPolicyDefault
Default read policy that is used when read command's policy is null.
|
boolean |
requestProleReplicas
Should prole replicas be requested from each server node in the cluster tend thread.
|
ScanPolicy |
scanPolicyDefault
Default scan policy that is used when scan command's policy is null.
|
boolean |
sharedThreadPool
Is threadPool shared between other client instances or classes.
|
int |
tendInterval
Interval in milliseconds between cluster tends by maintenance thread.
|
ExecutorService |
threadPool
Underlying thread pool used in synchronous batch, scan, and query commands.
|
int |
timeout
Initial host connection timeout in milliseconds.
|
TlsPolicy |
tlsPolicy
TLS secure connection policy for TLS enabled servers.
|
String |
user
User authentication to cluster.
|
boolean |
useServicesAlternate
Should use "services-alternate" instead of "services" in info request during cluster
tending.
|
WritePolicy |
writePolicyDefault
Default write policy that is used when write command's policy is null.
|
Constructor and Description |
---|
ClientPolicy()
Default constructor.
|
ClientPolicy(ClientPolicy other)
Copy client policy from another client policy.
|
public EventLoops eventLoops
public String user
public String password
public String clusterName
public AuthMode authMode
Default: INTERNAL
public int timeout
Default: 1000ms
public int loginTimeout
Default: 5000ms
public int maxConnsPerNode
The number of connections used per node depends on concurrent commands in progress plus sub-commands used for parallel multi-node commands (batch, scan, and query). One connection will be used for each command.
Default: 300
public int connPoolsPerNode
Default: 1
public int maxSocketIdle
It's important to set this value to a few seconds less than the server's proto-fd-idle-ms (default 60000 milliseconds or 1 minute), so the client does not attempt to use a socket that has already been reaped by the server.
This field is ignored by asynchronous transactions since these transactions use a non-blocking read to determine if the socket is active and empty.
Default: 55 seconds
public int tendInterval
public boolean failIfNotConnected
public Policy readPolicyDefault
public WritePolicy writePolicyDefault
public ScanPolicy scanPolicyDefault
public QueryPolicy queryPolicyDefault
public BatchPolicy batchPolicyDefault
public InfoPolicy infoPolicyDefault
public TlsPolicy tlsPolicy
public Map<String,String> ipMap
The key is the IP address returned from friend info requests to other servers. The value is the real IP address used to connect to the server.
public ExecutorService threadPool
threadPool = Executors.newCachedThreadPool(new ThreadFactory() { public final Thread newThread(Runnable runnable) { Thread thread = new Thread(runnable); thread.setDaemon(true); return thread; } });Daemon threads automatically terminate when the program terminates.
public boolean sharedThreadPool
If threadPool is shared, threadPool will not be shutdown when the client instance is closed. This shared threadPool should be shutdown manually before the program terminates. Shutdown is recommended, but not absolutely required if threadPool is constructed to use daemon threads.
public boolean requestProleReplicas
Policy.replica
==
Replica.MASTER_PROLES
or
Replica.SEQUENCE
).
If requestProleReplicas is enabled, all prole partition maps will be cached on the client which results in extra storage multiplied by the replication factor.
Default: true (request all master and prole replicas).
public boolean useServicesAlternate
"services-alternate" is available with Aerospike Server versions >= 3.7.1.
public boolean forceSingleNode
Should the AerospikeClient instance communicate with the first seed node only instead of using the data partition map to determine which node to send the database command.
Default: false
public ClientPolicy(ClientPolicy other)
public ClientPolicy()
Copyright ? 2012–2018 Aerospike, Inc. All rights reserved.