Package net.i2p.kademlia
package net.i2p.kademlia
This is a major rewrite of KBucket, KBucketSet, and KBucketImpl from net.i2p.router.networkdb.kademlia. The classes are now generic to support SHA1. SHA256, or other key lengths. Packaged in i2psnark since 0.9.2, and moved to core in 0.9.10 so the network database can use it.
-
ClassDescriptionKBucket<T extends SimpleDataStructure>Group, without inherent ordering, a set of keys a certain distance away from a local key, using XOR as the distance metric Refactored from net.i2p.router.networkdb.kademliaKBucketImpl<T extends SimpleDataStructure>A concurrent implementation using ConcurrentHashSet.KBucketSet<T extends SimpleDataStructure>In-memory storage of buckets sorted by the XOR metric from the base (us) passed in via the constructor.KBucketTrimmer<K extends SimpleDataStructure>Called when a kbucket can no longer be split and is too bigRandomIfOldTrimmer<T extends SimpleDataStructure>Removes a random element, but only if the bucket hasn't changed in 5 minutes.RandomTrimmer<T extends SimpleDataStructure>Removes a random element.RejectTrimmer<T extends SimpleDataStructure>Removes nothing and always rejects the add.SelectionCollector<T extends SimpleDataStructure>Visit kbuckets, gathering matchesXORComparator<T extends SimpleDataStructure>Help sort Hashes in relation to a base key using the XOR metric