code: public String getKeyForNode(MemcachedNode node, int repetition) {
          // Carrried over from the DefaultKetamaNodeLocatorConfiguration:
          // Internal Using the internal map retrieve the socket addresses
          // for given nodes.
          // I'm aware that this code is inherently thread-unsafe as
          // I'm using a HashMap implementation of the map, but the worst
          // case ( I believe) is we're slightly in-efficient when
          // a node has never been seen before concurrently on two different
          // threads, so it the socketaddress will be requested multiple times!
          // all other cases should be as fast as possible.
          String nodeKey = nodeKeys.get(node);
          if (nodeKey == null) {
              switch(this.format) {
                  case LIBMEMCACHED:
                      InetSocketAddress address = (InetSocketAddress)node.getSocketAddress();
                      nodeKey = address.getHostName();
                      if (address.getPort() != 11211) {
                          nodeKey += ":" + address.getPort();
                      }
                      break;
                  case SPYMEMCACHED:
                      nodeKey = String.valueOf(node.getSocketAddress());
                      if (nodeKey.startsWith("/")) {
                          nodeKey = nodeKey.substring(1);
                      }
                      break;
                  default:
                      assert false;
              }
              nodeKeys.put(node, nodeKey);
          }
          return nodeKey + "-" + repetition;
      }
docs: Returns a uniquely identifying key, suitable for hashing by the
  KetamaNodeLocator algorithm.
  
  @param node The MemcachedNode to use to form the unique identifier
  @param repetition The repetition number for the particular node in question
  (0 is the first repetition)
  @return The key that represents the specific repetition of the node