code: public static Map<InetSocketAddress, InetSocketAddress> getAddressMap(String s) {
      if (s == null) {
        throw new NullPointerException("Null host list");
      }
      if (s.trim().equals("")) {
        throw new IllegalArgumentException("No hosts in list:  ``" + s + "''");
      }
      s = s.trim();
      Map<InetSocketAddress, InetSocketAddress> result =
          new LinkedHashMap<InetSocketAddress, InetSocketAddress>();
      for (String hosts : s.split(" ")) {
        String[] nodes = hosts.split(",");
  
        if (nodes.length < 1) {
          throw new IllegalArgumentException("Invalid server ``" + hosts + "'' in list:  " + s);
        }
        String mainHost = nodes[0].trim();
        InetSocketAddress mainAddress = getInetSocketAddress(s, mainHost);
        if (nodes.length >= 2) {
          InetSocketAddress standByAddress = getInetSocketAddress(s, nodes[1].trim());
          result.put(mainAddress, standByAddress);
        } else {
          result.put(mainAddress, null);
        }
  
      }
      assert !result.isEmpty() : "No addrs found";
      return result;
    }
docs: 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
  
  @param s
  @return