/** * @param $key * @return Redis */ private function getRedis($key) { $pos = $this->getHash($key); $node = $this->hash->findNode($pos); $conn = $this->nodeMap[$node]; $redis = $this->connect($conn); //echo "$key => $conn\n"; return $redis; }
function testFindOne($i, $pos, $idList) { $hash = new Hashing($idList); $result = $hash->findNode($pos); assert($i == $result); echo '.'; }