public class AWSElasticCacheClient extends XMemcachedClient implements ConfigUpdateListener
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_POLL_CONFIG_INTERVAL_MS
Default elasticcache configuration poll interval, it's one minute.
|
commandFactory, connectionPoolSize, connector, maxQueuedNoReplyOperations, NAMESPACE_LOCAL, opTimeout, resolveInetAddresses, serverOrderCount, sessionComparator, sessionLocator
DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_POOL_SIZE, DEFAULT_HEAL_SESSION_INTERVAL, DEFAULT_MAX_QUEUED_NOPS, DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD, DEFAULT_OP_TIMEOUT, DEFAULT_READ_THREAD_COUNT, DEFAULT_SESSION_IDLE_TIMEOUT, DEFAULT_SESSION_READ_BUFF_SIZE, DEFAULT_TCP_KEEPLIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_RECV_BUFF_SIZE, DEFAULT_TCP_SEND_BUFF_SIZE, DYNAMIC_MAX_QUEUED_NOPS, MAX_QUEUED_NOPS
Constructor and Description |
---|
AWSElasticCacheClient(InetSocketAddress addr)
Construct an AWSElasticCacheClient instance with one config address and default poll interval.
|
AWSElasticCacheClient(InetSocketAddress addr,
long pollConfigIntervalMills)
Construct an AWSElasticCacheClient instance with one config address and poll interval.
|
AWSElasticCacheClient(InetSocketAddress addr,
long pollConfigIntervalMills,
CommandFactory cmdFactory) |
AWSElasticCacheClient(List<InetSocketAddress> addrs)
Construct an AWSElasticCacheClient instance with config server addresses and default config
poll interval.
|
AWSElasticCacheClient(List<InetSocketAddress> addrs,
long pollConfigIntervalMills)
Construct an AWSElasticCacheClient instance with config server addresses.
|
AWSElasticCacheClient(List<InetSocketAddress> addrs,
long pollConfigIntervalMills,
CommandFactory commandFactory)
Construct an AWSElasticCacheClient instance with config server addresses.
|
Modifier and Type | Method and Description |
---|---|
ClusterConfiguration |
getConfig()
Get cluster config from cache node by network command.
|
ClusterConfiguration |
getConfig(String key)
Get config by key from cache node by network command.
|
ClusterConfiguration |
getCurrentConfig()
Get the current using configuration in memory.
|
void |
onUpdate(ClusterConfiguration config)
Called when config is changed.
|
protected void |
shutdown0()
For subclass override.
|
add, add, add, add, addOneServerWithWeight, addServer, addServer, addServer, addServer, addServer, addStateListener, addWithNoReply, addWithNoReply, append, append, appendWithNoReply, beginWithNamespace, cas, cas, cas, cas, cas, cas, cas, cas, cas, cas, casWithNoReply, casWithNoReply, casWithNoReply, casWithNoReply, checkException, connect, decr, decr, decr, decr, decrWithNoReply, delete, delete, delete, delete, deleteWithNoReply, deleteWithNoReply, endWithNamespace, flushAll, flushAll, flushAll, flushAll, flushAll, flushAll, flushAll, flushAllWithNoReply, flushAllWithNoReply, flushAllWithNoReply, flushAllWithNoReply, get, get, get, get, get, get, get, get, getAndTouch, getAndTouch, getAuthInfoMap, getAuthInfoStringMap, getAvailableServers, getAvaliableServers, getCommandFactory, getConnectionSizeBySocketAddress, getConnector, getConnectTimeout, getCounter, getCounter, getHealSessionInterval, getKeyIterator, getKeyProvider, getName, getNamespace, getOpTimeout, getProtocol, getReconnectRequestQueue, gets, gets, gets, gets, gets, gets, gets, gets, getServersDescription, getSessionComparator, getSessionLocator, getStateListeners, getStats, getStats, getStatsByItem, getStatsByItem, getTimeoutExceptionThreshold, getTranscoder, getVersions, getVersions, incr, incr, incr, incr, incrWithNoReply, invalidateNamespace, invalidateNamespace, isFailureMode, isSanitizeKeys, isShutdown, latchWait, newConnector, newSocketAddress, prepend, prepend, prependWithNoReply, removeServer, removeServer, removeStateListener, replace, replace, replace, replace, replaceWithNoReply, replaceWithNoReply, sendCommand, set, set, set, set, setAuthInfoMap, setBufferAllocator, setConnectionPoolSize, setConnectTimeout, setEnableHealSession, setEnableHeartBeat, setFailureMode, setHealSessionInterval, setKeyProvider, setLoggingLevelVerbosity, setLoggingLevelVerbosityWithNoReply, setMergeFactor, setName, setOpTimeout, setOptimizeGet, setOptimizeMergeBuffer, setPrimitiveAsString, setSanitizeKeys, setServerWeight, setTimeoutExceptionThreshold, setTranscoder, setWithNoReply, setWithNoReply, shutdown, stats, stats, touch, touch, withNamespace
public static final long DEFAULT_POLL_CONFIG_INTERVAL_MS
public AWSElasticCacheClient(InetSocketAddress addr) throws IOException
addr
- config server address.IOException
public AWSElasticCacheClient(InetSocketAddress addr, long pollConfigIntervalMills) throws IOException
addr
- config server address.pollConfigIntervalMills
- config poll interval in milliseconds.IOException
public AWSElasticCacheClient(InetSocketAddress addr, long pollConfigIntervalMills, CommandFactory cmdFactory) throws IOException
IOException
public AWSElasticCacheClient(List<InetSocketAddress> addrs) throws IOException
addrs
- config server list.IOException
public AWSElasticCacheClient(List<InetSocketAddress> addrs, long pollConfigIntervalMills) throws IOException
addrs
- pollConfigIntervalMills
- IOException
public AWSElasticCacheClient(List<InetSocketAddress> addrs, long pollConfigIntervalMills, CommandFactory commandFactory) throws IOException
addrs
- config server list.pollConfigIntervalMills
- config poll interval in milliseconds.commandFactory
- protocol command factory.IOException
public void onUpdate(ClusterConfiguration config)
ConfigUpdateListener
onUpdate
in interface ConfigUpdateListener
config
- the new configpublic ClusterConfiguration getConfig() throws MemcachedException, InterruptedException, TimeoutException
MemcachedException
InterruptedException
TimeoutException
public ClusterConfiguration getConfig(String key) throws MemcachedException, InterruptedException, TimeoutException
MemcachedException
InterruptedException
TimeoutException
protected void shutdown0()
XMemcachedClient
shutdown0
in class XMemcachedClient
public ClusterConfiguration getCurrentConfig()
Copyright © 2021. All rights reserved.