Class AWSElasticCacheClient

    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • firstTimeUpdate

        private boolean firstTimeUpdate
      • configAddrs

        private java.util.List<java.net.InetSocketAddress> configAddrs
      • 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​(java.net.InetSocketAddress addr)
                              throws java.io.IOException
        Construct an AWSElasticCacheClient instance with one config address and default poll interval.
        Parameters:
        addr - config server address.
        Throws:
        java.io.IOException
        Since:
        2.3.0
      • AWSElasticCacheClient

        public AWSElasticCacheClient​(java.net.InetSocketAddress addr,
                                     long pollConfigIntervalMills)
                              throws java.io.IOException
        Construct an AWSElasticCacheClient instance with one config address and poll interval.
        Parameters:
        addr - config server address.
        pollConfigIntervalMills - config poll interval in milliseconds.
        Throws:
        java.io.IOException
        Since:
        2.3.0
      • AWSElasticCacheClient

        public AWSElasticCacheClient​(java.net.InetSocketAddress addr,
                                     long pollConfigIntervalMills,
                                     CommandFactory cmdFactory)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • AWSElasticCacheClient

        public AWSElasticCacheClient​(java.util.List<java.net.InetSocketAddress> addrs)
                              throws java.io.IOException
        Construct an AWSElasticCacheClient instance with config server addresses and default config poll interval.
        Parameters:
        addrs - config server list.
        Throws:
        java.io.IOException
        Since:
        2.3.0
      • AWSElasticCacheClient

        public AWSElasticCacheClient​(java.util.List<java.net.InetSocketAddress> addrs,
                                     long pollConfigIntervalMills)
                              throws java.io.IOException
        Construct an AWSElasticCacheClient instance with config server addresses.
        Parameters:
        addrs -
        pollConfigIntervalMills -
        Throws:
        java.io.IOException
        Since:
        2.3.0
      • AWSElasticCacheClient

        public AWSElasticCacheClient​(java.util.List<java.net.InetSocketAddress> addrs,
                                     long pollConfigIntervalMills,
                                     CommandFactory commandFactory)
                              throws java.io.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:
        java.io.IOException
        Since:
        2.3.0
    • Method Detail

      • removeConfigAddrs

        private void removeConfigAddrs()
      • asList

        private static java.util.List<java.net.InetSocketAddress> asList​(java.net.InetSocketAddress addr)
      • getAddressMapFromConfigAddrs

        private static java.util.Map<java.net.InetSocketAddress,​java.net.InetSocketAddress> getAddressMapFromConfigAddrs​(java.util.List<java.net.InetSocketAddress> configAddrs)
      • getConfig

        public ClusterConfiguration getConfig()
                                       throws MemcachedException,
                                              java.lang.InterruptedException,
                                              java.util.concurrent.TimeoutException
        Get cluster config from cache node by network command.
        Returns:
        Throws:
        MemcachedException
        java.lang.InterruptedException
        java.util.concurrent.TimeoutException
      • getConfig

        public ClusterConfiguration getConfig​(java.lang.String key)
                                       throws MemcachedException,
                                              java.lang.InterruptedException,
                                              java.util.concurrent.TimeoutException
        Get config by key from cache node by network command.
        Returns:
        clusetr config.
        Throws:
        MemcachedException
        java.lang.InterruptedException
        java.util.concurrent.TimeoutException
        Since:
        2.3.0
      • getCurrentConfig

        public ClusterConfiguration getCurrentConfig()
        Get the current using configuration in memory.
        Returns:
        current cluster config.
        Since:
        2.3.0