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 host connection fails during addHost().
|
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.
|
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
public int tendInterval
public boolean failIfNotConnected
public Policy readPolicyDefault
public WritePolicy writePolicyDefault
public ScanPolicy scanPolicyDefault
public QueryPolicy queryPolicyDefault
public BatchPolicy batchPolicyDefault
public Map<String,String> ipMap
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.
Copyright © 2012–2015 Aerospike, Inc. All rights reserved.