Interface BoundedConcurrentHashMap.EvictionPolicy<K,V>

Enclosing class:
BoundedConcurrentHashMap<K,V>

public static interface BoundedConcurrentHashMap.EvictionPolicy<K,V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked to notify EvictionPolicy implementation that all Segment entries have been cleared.
    io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V>
    createNewEntry(K key, int hash, io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> next, V value)
     
    Set<io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V>>
    Invokes eviction policy algorithm and returns set of evicted entries.
    boolean
    onEntryHit(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)
    Invoked to notify EvictionPolicy implementation that an entry in Segment has been accessed.
    Set<io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V>>
    onEntryMiss(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)
    Invoked to notify EvictionPolicy implementation that there has been an attempt to access an entry in Segment, however that entry was not present in Segment.
    void
    onEntryRemove(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)
    Invoked to notify EvictionPolicy implementation that an entry e has been removed from Segment.
    Returns type of eviction algorithm (strategy).
    boolean
    Returns true if batching threshold has expired, false otherwise.
  • Field Details

  • Method Details

    • createNewEntry

      io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> createNewEntry(K key, int hash, io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> next, V value)
    • execute

      Set<io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V>> execute()
      Invokes eviction policy algorithm and returns set of evicted entries. Set cannot be null but could possibly be an empty set.
      Returns:
      set of evicted entries.
    • onEntryMiss

      Set<io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V>> onEntryMiss(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)
      Invoked to notify EvictionPolicy implementation that there has been an attempt to access an entry in Segment, however that entry was not present in Segment.
      Parameters:
      e - accessed entry in Segment
      Returns:
      non null set of evicted entries.
    • onEntryHit

      boolean onEntryHit(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)

      Invoked to notify EvictionPolicy implementation that an entry in Segment has been accessed. Returns true if batching threshold has been reached, false otherwise.

      Note that this method is potentially invoked without holding a lock on Segment.
      Parameters:
      e - accessed entry in Segment
      Returns:
      true if batching threshold has been reached, false otherwise.
    • onEntryRemove

      void onEntryRemove(io.confluent.kafka.schemaregistry.utils.BoundedConcurrentHashMap.HashEntry<K,V> e)
      Invoked to notify EvictionPolicy implementation that an entry e has been removed from Segment.
      Parameters:
      e - removed entry in Segment
    • clear

      void clear()
      Invoked to notify EvictionPolicy implementation that all Segment entries have been cleared.
    • strategy

      Returns type of eviction algorithm (strategy).
      Returns:
      type of eviction algorithm
    • thresholdExpired

      boolean thresholdExpired()

      Returns true if batching threshold has expired, false otherwise.

      Note that this method is potentially invoked without holding a lock on Segment.
      Returns:
      true if batching threshold has expired, false otherwise.