Interface BoundedConcurrentHashMap.EvictionPolicy<K,​V>

    • Method Detail

      • execute

        Set<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.
      • onEntryHit

        boolean onEntryHit​(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​(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.