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

ConsistentHash formula #156

Closed
rogeralsing opened this issue Jun 29, 2014 · 6 comments
Closed

ConsistentHash formula #156

rogeralsing opened this issue Jun 29, 2014 · 6 comments
Assignees

Comments

@rogeralsing
Copy link
Contributor

The ConsistentHash routers in Akka uses Murmur hash to ensure even distribution.
Our version simply uses GetHashCode() atm.
Do we need Murmur hash or is the built in .NET hashcode enough to ensure even distribution among routees?

@HCanber
Copy link
Contributor

HCanber commented Jun 29, 2014

Haven't looked at the code, but are the hashes ever used between processes or AppDomains? If yes, then we must implement something else.

@Aaronontheweb
Copy link
Member

What a coincidence - I'm working on an open-source HyperLogLog implementation (which we'll be using in combination with Akka.NET) and as part of this I've had to implement Murmur3.

I'm still doing some bugfixes with my Murmur3 implementation, but I should have a copy of it available later this week. I have both a 32-bit Murmur3 and 128-bit Murmur3 implementation, but I'm thinking about canning the 128-bit one. For our purposes it's probably overkill.

@rogeralsing rogeralsing self-assigned this Jul 7, 2014
@rogeralsing
Copy link
Contributor Author

Related to #11

@Aaronontheweb
Copy link
Member

Here's the Murmur3 implementation I want to use, from MarkedUp's new OpenMetrics project:

https://github.com/markedup-mobi/openmetrics/blob/master/src/MarkedUp.HyperLogLog/Hash/Murmur3.cs

It's been performance tested for collisions and hashing speed (clone the project to find out for yourself ;)) and is based off of the canonical C++ implementation and the developer interface (how it gets used by programmers) is based off of Scala's internal Murmur3 implementation.

I'm planning on lumping this and https://github.com/markedup-mobi/openmetrics/blob/master/src/MarkedUp.HyperLogLog/BitArrayHelpers.cs (used mostly for hashing decimal types) into a single file and drop it directly into Akka.NET in the Utils / Tools space.

Any objections?

@rogeralsing
Copy link
Contributor Author

    /// Finalization mix - force all bits of a hash block to avalanche.
    /// 
    /// I have no idea what that means but it sound awesome.

👯

Go for it

@HCanber
Copy link
Contributor

HCanber commented Jul 9, 2014

+1

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

No branches or pull requests

3 participants