Package io.debezium.util
Class BoundedConcurrentHashMap.NullEvictionPolicy<K,V>
- java.lang.Object
-
- io.debezium.util.BoundedConcurrentHashMap.NullEvictionPolicy<K,V>
-
- All Implemented Interfaces:
BoundedConcurrentHashMap.EvictionPolicy<K,V>
- Enclosing class:
- BoundedConcurrentHashMap<K,V>
static class BoundedConcurrentHashMap.NullEvictionPolicy<K,V> extends Object implements BoundedConcurrentHashMap.EvictionPolicy<K,V>
-
-
Field Summary
-
Fields inherited from interface io.debezium.util.BoundedConcurrentHashMap.EvictionPolicy
MAX_BATCH_SIZE
-
-
Constructor Summary
Constructors Constructor Description NullEvictionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Invoked to notify EvictionPolicy implementation that all Segment entries have been cleared.BoundedConcurrentHashMap.HashEntry<K,V>createNewEntry(K key, int hash, BoundedConcurrentHashMap.HashEntry<K,V> next, V value)Set<BoundedConcurrentHashMap.HashEntry<K,V>>execute()Invokes eviction policy algorithm and returns set of evicted entries.booleanonEntryHit(BoundedConcurrentHashMap.HashEntry<K,V> e)Invoked to notify EvictionPolicy implementation that an entry in Segment has been accessed.Set<BoundedConcurrentHashMap.HashEntry<K,V>>onEntryMiss(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.voidonEntryRemove(BoundedConcurrentHashMap.HashEntry<K,V> e)Invoked to notify EvictionPolicy implementation that an entry e has been removed from Segment.BoundedConcurrentHashMap.Evictionstrategy()Returns type of eviction algorithm (strategy).booleanthresholdExpired()Returns true if batching threshold has expired, false otherwise.
-
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyInvoked to notify EvictionPolicy implementation that all Segment entries have been cleared.- Specified by:
clearin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>
-
execute
public Set<BoundedConcurrentHashMap.HashEntry<K,V>> execute()
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyInvokes eviction policy algorithm and returns set of evicted entries. Set cannot be null but could possibly be an empty set.- Specified by:
executein interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Returns:
- set of evicted entries.
-
onEntryHit
public boolean onEntryHit(BoundedConcurrentHashMap.HashEntry<K,V> e)
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyInvoked 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.- Specified by:
onEntryHitin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Parameters:
e- accessed entry in Segment- Returns:
- true if batching threshold has been reached, false otherwise.
-
onEntryMiss
public Set<BoundedConcurrentHashMap.HashEntry<K,V>> onEntryMiss(BoundedConcurrentHashMap.HashEntry<K,V> e)
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyInvoked to notify EvictionPolicy implementation that there has been an attempt to access an entry in Segment, however that entry was not present in Segment.- Specified by:
onEntryMissin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Parameters:
e- accessed entry in Segment- Returns:
- non null set of evicted entries.
-
onEntryRemove
public void onEntryRemove(BoundedConcurrentHashMap.HashEntry<K,V> e)
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyInvoked to notify EvictionPolicy implementation that an entry e has been removed from Segment.- Specified by:
onEntryRemovein interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Parameters:
e- removed entry in Segment
-
thresholdExpired
public boolean thresholdExpired()
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyReturns true if batching threshold has expired, false otherwise. Note that this method is potentially invoked without holding a lock on Segment.- Specified by:
thresholdExpiredin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Returns:
- true if batching threshold has expired, false otherwise.
-
strategy
public BoundedConcurrentHashMap.Eviction strategy()
Description copied from interface:BoundedConcurrentHashMap.EvictionPolicyReturns type of eviction algorithm (strategy).- Specified by:
strategyin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>- Returns:
- type of eviction algorithm
-
createNewEntry
public BoundedConcurrentHashMap.HashEntry<K,V> createNewEntry(K key, int hash, BoundedConcurrentHashMap.HashEntry<K,V> next, V value)
- Specified by:
createNewEntryin interfaceBoundedConcurrentHashMap.EvictionPolicy<K,V>
-
-