class Redis::HashRing
def get_node_pos(key)
def get_node_pos(key) return [nil, nil] if @ring.empty? crc = Zlib.crc32(key) idx = HashRing.binary_search(@sorted_keys, crc) [@ring[@sorted_keys[idx]], idx] end
def get_node_pos(key) return [nil, nil] if @ring.empty? crc = Zlib.crc32(key) idx = HashRing.binary_search(@sorted_keys, crc) [@ring[@sorted_keys[idx]], idx] end