Class LRUCacheMap<K,V>

java.lang.Object
io.debezium.util.LRUCacheMap<K,V>
All Implemented Interfaces:
org.apache.kafka.common.cache.Cache<K,V>

@NotThreadSafe public class LRUCacheMap<K,V> extends Object implements org.apache.kafka.common.cache.Cache<K,V>
A custom implementation of LRUCache that allows exposure to the underlying delegate's key or values collections.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • LRUCacheMap

      public LRUCacheMap(int maxSize)
  • Method Details

    • get

      public V get(K key)
      Specified by:
      get in interface org.apache.kafka.common.cache.Cache<K,V>
    • put

      public void put(K key, V value)
      Specified by:
      put in interface org.apache.kafka.common.cache.Cache<K,V>
    • remove

      public boolean remove(K key)
      Specified by:
      remove in interface org.apache.kafka.common.cache.Cache<K,V>
    • size

      public long size()
      Specified by:
      size in interface org.apache.kafka.common.cache.Cache<K,V>
    • keySet

      public Set<K> keySet()
    • values

      public Collection<V> values()
    • toString

      public String toString()
      Overrides:
      toString in class Object