Package net.i2p.kademlia

This is a major rewrite of KBucket, KBucketSet, and KBucketImpl from net.i2p.router.networkdb.kademlia.

See:
          Description

Interface Summary
KBucket<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.kademlia
KBucketTrimmer<K extends SimpleDataStructure> Called when a kbucket can no longer be split and is too big
SelectionCollector<T extends SimpleDataStructure> Visit kbuckets, gathering matches
 

Class Summary
KBucketImpl<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.
RandomIfOldTrimmer<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.
XORComparator<T extends SimpleDataStructure> Help sort Hashes in relation to a base key using the XOR metric
 

Package net.i2p.kademlia Description

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.