Sha256: 6652946d7ea9cb377a2b0d8dfa2d6a07ed9d1b5fc403951968157f2e2c03e4c2

Contents?: true

Size: 758 Bytes

Versions: 2

Compression:

Stored size: 758 Bytes

Contents

= ConsistentHashr

A small module to do easy consistent hashing.

== Usage

hashr = ConsistentHashr.new()

hashr.add_server("s1", "server1")
hashr.add_server("s2", "server2")
hashr.add_server("s3", "server3")
hashr.add_server("s4", "server4")
hashr.add_server("s5", "server5")

hashr.get(key) # Should return the same key consistently when new servers are added.

== Implementation

Based on "Mike Perham's":http://www.mikeperham.com/ "code":http://www.mikeperham.com/2009/01/14/consistent-hashing-in-memcache-client/ and tests. I thought this layer didn't belong to any specific client, this is why I extracted it.

Greatly inspired by "Tom White's consistent hashing explaination":http://weblogs.java.net/blog/tomwhite/archive/2007/11/consistent_hash.html.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
consistent_hashr-1.1.0 README.rdoc
consistent_hashr-1.0.0 README.rdoc