public Range<Token> getRange(ByteBuffer key)
    {
        // TODO: naive linear search of the token map
        Token<?> t = partitioner.getToken(key);
        for (Range<Token> range : rangeMap.keySet())
            if (range.contains(t))
                return range;
        throw new RuntimeException("Invalid token information returned by describe_ring: " + rangeMap);
    }
public Range<Token> getRange(ByteBuffer key)
    {
       
        Token<?> t = partitioner.getToken(key);
        for (Range<Token> range : rangeMap.keySet())
            if (range.contains(t))
                return range;
        throw new RuntimeException("Invalid token information returned by describe_ring: " + rangeMap);
    }
public range<token> getrange(bytebuffer key) { token<?> t = partitioner.gettoken(key); for (range<token> range : rangemap.keyset()) if (range.contains(t)) return range; throw new runtimeexception("invalid token information returned by describe_ring: " + rangemap); }