0

If my input key hashes to anywhere between machine1 and machine2 in the circle, and our algorithm goes clockwise, then we know machine2 will be returned.

consistentHash.getMachine(myInput) = machine2;

What if I want to avoid machine2 for myInput? Say, myInput is an account ID and it has maximized its budget on machine2. Is there a way to specify that extra info and get back machine0 instead, i.e.

consistentHash.getMachine(input, excludes=[machine2]) = machine0;

I'm interested in both an algorithmic explanation and any existing implementations/libraries (Java preferred), if they exist.

Text

(Image source: http://michaelnielsen.org/blog/consistent-hashing)

2
  • Fyi, your link gives a 404 Commented Feb 21, 2020 at 19:34
  • Thanks! Apparently SO decided the link should include the _ I put at its end for italic ... Commented Feb 21, 2020 at 19:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.