public static interface ConsistentHash.Hash<T>
By default, ConsistentHash
uses Object.toString()
on 'T' to
obtain the hash, but that behavior can be changed by providing
a ConsistentHash.Hash
implementation.
This hash function need not produce a very uniform distribution, as the output is rehashed with MD5. But it does need to make sure it doesn't produce the same value for two different 'T's (and that's why this returns String, not the usual int.)
Modifier and Type | Method and Description |
---|---|
String |
hash(T t) |
Copyright © 2017. All rights reserved.