Package org.apache.zookeeper.server.util
Class AdHash
- java.lang.Object
- 
- org.apache.zookeeper.server.util.AdHash
 
- 
 public class AdHash extends Object This incremental hash is used to keep track of the hash of the data tree to that we can quickly validate that things are in sync. See the excellent paper: A New Paradigm for collision-free hashing: Incrementality at reduced cost, M. Bellare and D. Micciancio
- 
- 
Constructor SummaryConstructors Constructor Description AdHash()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AdHashaddDigest(long digest)Add new digest to the hash value maintained in this class.voidclear()booleanequals(Object other)longgetHash()Return the long value of the hash.inthashCode()AdHashremoveDigest(long digest)Remove the digest from the hash value.StringtoString()
 
- 
- 
- 
Method Detail- 
addDigestpublic AdHash addDigest(long digest) Add new digest to the hash value maintained in this class.- Parameters:
- digest- the value to add on
- Returns:
- the AdHash itself for chained operations
 
 - 
removeDigestpublic AdHash removeDigest(long digest) Remove the digest from the hash value.- Parameters:
- digest- the value to remove
- Returns:
- the AdHash itself for chained operations
 
 - 
getHashpublic long getHash() Return the long value of the hash.
 - 
clearpublic void clear() 
 
- 
 
-