Class AddrUtil


  • public class AddrUtil
    extends Object
    Convenience utilities for simplifying common address parsing.
    • Constructor Detail

      • AddrUtil

        public AddrUtil()
    • Method Detail

      • getAddressMap

        public static Map<InetSocketAddress,​InetSocketAddress> getAddressMap​(String s)
        Split a string in the form of "host1:port1,host2:port2 host3:port3,host4:port4" into a Map of InetSocketAddress instances suitable for instantiating a MemcachedClient,map's key is the main memcached node,and value is the standby node for main node. Note that colon-delimited IPv6 is also supported. For example: ::1:11211
        Parameters:
        s -
        Returns:
      • getAddresses

        public static List<InetSocketAddress> getAddresses​(String s)
        Split a string in the form of "host:port host2:port" into a List of InetSocketAddress instances suitable for instantiating a MemcachedClient. Note that colon-delimited IPv6 is also supported. For example: ::1:11211
      • isEnableShutDownHook

        public static boolean isEnableShutDownHook()
        System property to control shutdown hook, issue #44
        Since:
        2.0.1
      • getServerString

        public static final String getServerString​(InetSocketAddress addr)
        Create an unresolved server string (hostname:port) from an InetSocketAddress.