Package net.rubyeye.xmemcached.aws
Class AWSElasticCacheClient
- java.lang.Object
-
- net.rubyeye.xmemcached.XMemcachedClient
-
- net.rubyeye.xmemcached.aws.AWSElasticCacheClient
-
- All Implemented Interfaces:
ConfigUpdateListener,MemcachedClient,XMemcachedClientMBean
public class AWSElasticCacheClient extends XMemcachedClient implements ConfigUpdateListener
AWS ElasticCache Client.- Since:
- 2.3.0
- Author:
- dennis
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_POLL_CONFIG_INTERVAL_MSDefault elasticcache configuration poll interval, it's one minute.-
Fields inherited from class net.rubyeye.xmemcached.XMemcachedClient
commandFactory, connectionPoolSize, connector, maxQueuedNoReplyOperations, NAMESPACE_LOCAL, opTimeout, resolveInetAddresses, serverOrderCount, sessionComparator, sessionLocator
-
Fields inherited from interface net.rubyeye.xmemcached.MemcachedClient
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 Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusterConfigurationgetConfig()Get cluster config from cache node by network command.ClusterConfigurationgetConfig(String key)Get config by key from cache node by network command.ClusterConfigurationgetCurrentConfig()Get the current using configuration in memory.voidonUpdate(ClusterConfiguration config)Called when config is changed.protected voidshutdown0()For subclass override.-
Methods inherited from class net.rubyeye.xmemcached.XMemcachedClient
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
-
-
-
-
Field Detail
-
DEFAULT_POLL_CONFIG_INTERVAL_MS
public static final long DEFAULT_POLL_CONFIG_INTERVAL_MS
Default elasticcache configuration poll interval, it's one minute.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AWSElasticCacheClient
public AWSElasticCacheClient(InetSocketAddress addr) throws IOException
Construct an AWSElasticCacheClient instance with one config address and default poll interval.- Parameters:
addr- config server address.- Throws:
IOException- Since:
- 2.3.0
-
AWSElasticCacheClient
public AWSElasticCacheClient(InetSocketAddress addr, long pollConfigIntervalMills) throws IOException
Construct an AWSElasticCacheClient instance with one config address and poll interval.- Parameters:
addr- config server address.pollConfigIntervalMills- config poll interval in milliseconds.- Throws:
IOException- Since:
- 2.3.0
-
AWSElasticCacheClient
public AWSElasticCacheClient(InetSocketAddress addr, long pollConfigIntervalMills, CommandFactory cmdFactory) throws IOException
- Throws:
IOException
-
AWSElasticCacheClient
public AWSElasticCacheClient(List<InetSocketAddress> addrs) throws IOException
Construct an AWSElasticCacheClient instance with config server addresses and default config poll interval.- Parameters:
addrs- config server list.- Throws:
IOException- Since:
- 2.3.0
-
AWSElasticCacheClient
public AWSElasticCacheClient(List<InetSocketAddress> addrs, long pollConfigIntervalMills) throws IOException
Construct an AWSElasticCacheClient instance with config server addresses.- Parameters:
addrs-pollConfigIntervalMills-- Throws:
IOException- Since:
- 2.3.0
-
AWSElasticCacheClient
public AWSElasticCacheClient(List<InetSocketAddress> addrs, long pollConfigIntervalMills, CommandFactory commandFactory) throws IOException
Construct an AWSElasticCacheClient instance with config server addresses.- Parameters:
addrs- config server list.pollConfigIntervalMills- config poll interval in milliseconds.commandFactory- protocol command factory.- Throws:
IOException- Since:
- 2.3.0
-
-
Method Detail
-
onUpdate
public void onUpdate(ClusterConfiguration config)
Description copied from interface:ConfigUpdateListenerCalled when config is changed.- Specified by:
onUpdatein interfaceConfigUpdateListener- Parameters:
config- the new config
-
getConfig
public ClusterConfiguration getConfig() throws MemcachedException, InterruptedException, TimeoutException
Get cluster config from cache node by network command.- Returns:
- Throws:
MemcachedExceptionInterruptedExceptionTimeoutException
-
getConfig
public ClusterConfiguration getConfig(String key) throws MemcachedException, InterruptedException, TimeoutException
Get config by key from cache node by network command.- Returns:
- clusetr config.
- Throws:
MemcachedExceptionInterruptedExceptionTimeoutException- Since:
- 2.3.0
-
shutdown0
protected void shutdown0()
Description copied from class:XMemcachedClientFor subclass override.- Overrides:
shutdown0in classXMemcachedClient
-
getCurrentConfig
public ClusterConfiguration getCurrentConfig()
Get the current using configuration in memory.- Returns:
- current cluster config.
- Since:
- 2.3.0
-
-