Пример #1
0
def test_rehashing():
    """
    Tests key rehashing for replication.
    """
    count = 3
    rehashed = rehash('example', count)
    assert len(rehashed) == count
    assert len(set(rehashed)) == count
Пример #2
0
 def rehash(self, key):
     return map(lambda hash: '%s:%s' % (key, hash),
         rehash(key, self.replica_count))