Interface BoundedConcurrentHashMap.EvictionPolicy<K,​V>

    • Field Summary

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Invoked to notify EvictionPolicy implementation that all Segment entries have been cleared.
      org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> createNewEntry​(K key, int hash, org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> next, V value)  
      void execute()
      Invokes eviction policy algorithm.
      boolean onEntryHit​(org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> e)
      Invoked to notify EvictionPolicy implementation that an entry in Segment has been accessed.
      void onEntryMiss​(org.hibernate.internal.util.collections.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​(org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> e)
      Invoked to notify EvictionPolicy implementation that an entry e has been removed from Segment.
      BoundedConcurrentHashMap.Eviction strategy()
      Returns type of eviction algorithm (strategy).
      boolean thresholdExpired()
      Returns true if batching threshold has expired, false otherwise.
    • Method Detail

      • createNewEntry

        org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> createNewEntry​(K key,
                                                                                                             int hash,
                                                                                                             org.hibernate.internal.util.collections.BoundedConcurrentHashMap.HashEntry<K,​V> next,
                                                                                                             V value)
      • execute

        void execute()
        Invokes eviction policy algorithm.
      • onEntryMiss

        void onEntryMiss​(org.hibernate.internal.util.collections.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
      • onEntryHit

        boolean onEntryHit​(org.hibernate.internal.util.collections.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​(org.hibernate.internal.util.collections.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.
      • 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.