roc230 / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

How can I use my own hash algorithm implementation #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?
memcached-2.2

I'm trying to specify my own hash algorithm to memcached client but don't
know how.

Original issue reported on code.google.com by bulat...@gmail.com on 20 Mar 2009 at 7:35

GoogleCodeExporter commented 9 years ago
Oh! I'm sorry. I found solution: i should extend DefaultConnectionFactory and
override createLocator(List<MemcachedNode> nodes) method.
Am I right?

Original comment by bulat...@gmail.com on 20 Mar 2009 at 7:44

GoogleCodeExporter commented 9 years ago
HashAlgorithm is an enum, so the only method of adding one that isn't included
involves source changes.

Is there one in particular you'd like to include?  Perhaps we could get it into 
the
next release?

Original comment by dsalli...@gmail.com on 20 Mar 2009 at 7:49

GoogleCodeExporter commented 9 years ago
My first post was wrong. Really I was looking for primary server for key 
specifying.
So I now should implement my NodeLocator and return it on
createLocator(List<MemcachedNode> nodes) call in my own ConnectionFactory
implemention extending DefaultConnectionFactory.

Original comment by bulat...@gmail.com on 20 Mar 2009 at 7:56

GoogleCodeExporter commented 9 years ago
Oh.  Yeah.  "Consistent hashing" confuses hashing and node location.  I like to 
keep
them separate.

Original comment by dsalli...@gmail.com on 20 Mar 2009 at 8:00