Some background: Eric Veach is huge in the computer graphics world for laying a ton of the foundations of modern physically based rendering in his PhD thesis [1]. He then went on to work for Pixar and did a ton of work on Renderman (for which he recently got an Academy Award), and then in the early 2000ish left Pixar to go work for Google, where he was the lead on developing AdWords [2]. In short, he's had quite a career, and seeing a new paper from him is always interesting.
[1] https://graphics.stanford.edu/papers/veach_thesis/ [2] http://www.bloomberg.com/bw/stories/2006-03-05/the-secret-to...
Thanks, Google:
> Google has not applied for patent protection for this algorithm, and, as of this writing, has no plans to. Rather, it wishes to contribute this algorithm to the community.
What they should do (IANAL) is patent it and license it properly. This way it's protected (patented), but the intent is clear and future-proof instead of leaving it in an ambiguous legal gray area.
Protected from what ?
And Google can't quite change their mind "at any moment" – more than one year after the first public offer/description of the technique, under US law, it won't be patentable. So by June 9, 2015, if they haven't patented it by then, they won't be able to.
(It's likely already too late to patent in other jurisdictions, that don't have such a long public-description grace-period.)
However it does seem unlikely that there will be a patent. :-)
https://news.ycombinator.com/item?id=8140385
It feels like there should be some faster way of doing the jump calculation that doesn't require the floating point divide. Relatively, it's a slow and expensive operation, and doing ln(n) of them on each bucket lookup would add up to a lot if you have lots of buckets.
Take any 8 byte value b, multiply by 16133697096952638549ULL (mod 2^64) to get a value for the key. Now key * 2862933555777941757ULL = b. Thus there is an input value for key that I can make hit any number. The first and last 4 bytes are thus certainly not always nonzero.
He then uses "The fact that the first 4 bytes become nonzero is important for the next step" and proceeds. This is wrong.
For a concrete example, suppose key is 16133697096952638549ULL. Then key * 2862933555777941757ULL = 1. The first 7 bytes (actually, the first 63 bits) are all zero. Adding 1 as in the code still leaves the first 62 bits zero.
(the value 16133697096952638549ULL is the multiplicative inverse of the constant in the algorithm mod 2^64).
https://news.ycombinator.com/item?id=8136408
It's been in guava for a few years now.
This technique also requires the shards be assigned contiguous integer ID starting at 0, and appears to work best if all shard entry/exit is intentional and at the end of the ID range. (That is: if you have 15 shards, they're named #0-#14. If you decide you need one less, you turn off shard #14.)
It doesn't appear to work well for systems with more chaotic entry/exit. (Shard #4 just crashed, and you don't need it anymore? You'd still want to restart/fill one shard as #4, then shut-down/drain shard #14. Other consistent-hashes could just map #4's old duties among the remaining nodes, albeit with their higher space/time costs.)
It works well when adding nodes, but then how does it work when removing a node in the middle? When allocating nodes in a ring it's easy, just reassign the vnodes. But what with this algorithm? Can anybody explain how does it keep track of which nodes take control of which part of the removed node?