// ------------------------------------------------------------------------
/* (non-Javadoc) @see org.jredis.cluster.ClusterModel#getNodeForKey(byte[]) */
public ClusterNodeSpec getNodeForKey (byte[] key) {
long hash = hashAlgo.hash(key);
final ClusterNodeSpec rv;
if(!nodeMap.containsKey(hash)) {
// Java 1.6 adds a ceilingKey method, but I'm still stuck in 1.5
// in a lot of places, so I'm doing this myself.
SortedMap<Long, ClusterNodeSpec> tailMap=nodeMap.tailMap(hash);
if(tailMap.isEmpty()) {