Interface KBucketTrimmer<K extends SimpleDataStructure>

All Known Implementing Classes:
KBTrimmer, RandomIfOldTrimmer, RandomTrimmer, RejectTrimmer

public interface KBucketTrimmer<K extends SimpleDataStructure>
Called when a kbucket can no longer be split and is too big
Since:
0.9.2 in i2psnark, moved to core in 0.9.10
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    trim(KBucket<K> kbucket, K toAdd)
    Called from add() just before adding the entry.
  • Method Details

    • trim

      boolean trim(KBucket<K> kbucket, K toAdd)
      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.
      Parameters:
      kbucket - the kbucket that is now too big
      Returns:
      true to actually add the entry.