private int getServerForKey(String key) {
    int rv = (int) (hashAlg.hash(key) % nodes.length);
    assert rv >= 0 : "Returned negative key for key " + key;
    assert rv < nodes.length : "Invalid server number " + rv + " for key "
        + key;
    return rv;
  }
Construct an ArraymodNodeLocator over the given array of nodes and using
the given hash algorithm.

@param n the array of nodes
@param alg the hash algorithm
src/main/java/net/spy/memcached/ArrayModNodeLocator.java