Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: customizable node locators for ketama #40

Open
spkrka opened this issue Feb 26, 2015 · 6 comments
Open

Feature request: customizable node locators for ketama #40

spkrka opened this issue Feb 26, 2015 · 6 comments

Comments

@spkrka
Copy link
Member

spkrka commented Feb 26, 2015

It would be nice to be able to tweak the actual node location logic in the ketama setup (hash key to integer, hash machines + node number to virtual nodes in a ring, et.c.) to make it easier to be compatible with other ketama implementations (such as spymemcached). This would make a lot of transitions easier.

@protocol7
Copy link
Contributor

I got a branch somewhere where I refactored out a hasher interface for this exact purpose. When I get the cycled I can dig it up.

@azagorneanu
Copy link

azagorneanu commented Aug 15, 2022

@spkrka @protocol7 I'm trying to migrate from another memcached library to Folsom and I'm also missing this feature. I need to be able to customize the call to Continuum.findClient(byte[] key).

For example I want to customize so that all the keys that start with some common prefix go to the same node:

  • prefix1-sufix1 key - goes to node 1
  • prefix1-sufix2 key - goes to node 1
  • prefix2-sufix3 key - goes to node 2

@azagorneanu
Copy link

Some kind of SessionLocator or NodeLocator abstractization would be nice to have. Then we can provide custom implementations or extend/reuse the existing ones(e.g. KetamaSessionLocator).

@protocol7
Copy link
Contributor

@azagorneanu I never got around to finishing up my branch, but I would still agree that a node locator would be a nice abstraction to have pluggable. If you're up for proposing a PR, I would be happy to take a look.

@spkrka
Copy link
Member Author

spkrka commented Aug 17, 2022

I agree it would be useful. I tried playing around with adding something, but without having an explicit use case in mind it is harder, so I would also prefer having a proposal to review.

@azagorneanu
Copy link

Cool! I will try to send a PR for review. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants