ketama - a consistent hashing algo for memcache clients

Dustin Sallings dustin at
Tue Apr 10 22:23:20 UTC 2007

On Apr 10, 2007, at 15:01 , Richard Jones wrote:

> Check the init() method - that builds up the appropriate data  
> structure (a
> TreeMap called buckets iirc). You can use any hashing mechanism you  
> want
> instead of the md5 thing, that just seemed a convenient way to  
> generate a
> bunch of hashes. If you change it you won't be compatible with other
> implementations - not a problem if you are exclusively using java tho.
> Once you've build the data structure using the servers list, that  
> is pretty
> much it in java, just check how keys are mapped to servers in  
> findPointFor().

	Oh, interesting.  I've got two hash algorithms now.  I should be  
able to add md5, and then have an orthogonal server selection based  
on a hash.

	Thanks for the pointers.  And thanks for ketama_test...  I like  
references I can run tests against.

Dustin Sallings

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list