Package org.klomp.snark.dht
Class KBTrimmer
java.lang.Object
org.klomp.snark.dht.KBTrimmer
- All Implemented Interfaces:
KBucketTrimmer<NID>
Removes an element older than 15 minutes, but only if the bucket hasn't changed in 5 minutes.
- Since:
- 0.9.2
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
KBTrimmer
-
-
Method Details
-
trim
Description copied from interface:KBucketTrimmer
Called from add() just before adding the entry. You may call getEntries() and/or remove() from here. Do NOT call add(). To always discard a newer entry, always return false.- Specified by:
trim
in interfaceKBucketTrimmer<NID>
- Parameters:
kbucket
- the kbucket that is now too big- Returns:
- true to actually add the entry.
-