Type Parameters:
K - type of SimpleDataStructure objects in the bucket
All Known Implementing Classes:
KBTrimmer, RandomIfOldTrimmer, RandomTrimmer, RejectTrimmer, StaleContactTrimmer

public interface KBucketTrimmer<K extends SimpleDataStructure>
Called when a kbucket can no longer be split and is too big.
  • Method Summary

    All Methods
    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
      toAdd - the entry the bucket is about to accept
      Returns:
      true to actually add the entry.