Package net.rubyeye.xmemcached.utils
Class AddrUtil
java.lang.Object
net.rubyeye.xmemcached.utils.AddrUtil
Convenience utilities for simplifying common address parsing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<InetSocketAddress> Split a string in the form of "host:port host2:port" into a List of InetSocketAddress instances suitable for instantiating a MemcachedClient.static Map
<InetSocketAddress, InetSocketAddress> 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.private static InetSocketAddress
getInetSocketAddress
(String s, String mainHost) static InetSocketAddress
getOneAddress
(String server) static final String
Create an unresolved server string (hostname:port) from an InetSocketAddress.static boolean
System property to control shutdown hook, issue #44
-
Constructor Details
-
AddrUtil
public AddrUtil()
-
-
Method Details
-
getAddressMap
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:
-
getInetSocketAddress
-
getAddresses
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 -
getOneAddress
-
isEnableShutDownHook
public static boolean isEnableShutDownHook()System property to control shutdown hook, issue #44- Since:
- 2.0.1
-
getServerString
Create an unresolved server string (hostname:port) from an InetSocketAddress.
-