hudson.util
Interface ConsistentHash.Hash<T>
- Enclosing class:
- ConsistentHash<T>
public static interface ConsistentHash.Hash<T>
Hashes an object to some value.
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.)
hash
String hash(T t)
- Parameters:
t
- The object to be hashed. Never null.
- Returns:
- The hash value.
Copyright © 2004-2013. All Rights Reserved.