public class ClientPolicy extends Object
Modifier and Type | Field and Description |
---|---|
BatchPolicy |
batchPolicyDefault
Default batch policy that is used when batch command's policy is null.
|
boolean |
failIfNotConnected
Throw exception if all seed connections fail on cluster instantiation.
|
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 |
maxSocketIdle
Maximum socket idle in seconds.
|
int |
maxThreads
Estimate of incoming threads concurrently using synchronous methods in the client instance.
|
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 batch, scan, and query commands.
|
int |
timeout
Initial host connection timeout in milliseconds.
|
String |
user
User authentication to cluster.
|
WritePolicy |
writePolicyDefault
Default write policy that is used when write command's policy is null.
|
Constructor and Description |
---|
ClientPolicy() |
public String user
public String password
public int timeout
public int maxThreads
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. 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 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
).
If requestProleReplicas is enabled, all prole partition maps will be cached on the client which results in extra storage multiplied by the replication factor.
The default is false (only request master replicas and never prole replicas).
Copyright © 2012–2015 Aerospike, Inc. All rights reserved.