Class ConcurrentCache<K,V>

java.lang.Object
org.eclipse.rdf4j.sail.lmdb.ConcurrentCache<K,V>

public class ConcurrentCache<K,V> extends Object
Limited-size concurrent cache. The actual cleanup to keep the size limited is done once per CLEANUP_INTERVAL invocations of the protected method cleanUp. cleanUp method is called every time by put The maximum size is maintained approximately. Cleanup is not done if size is less than capacity + CLEANUP_INTERVAL / 2.
  • Field Details Link icon

  • Constructor Details Link icon

    • ConcurrentCache Link icon

      public ConcurrentCache(int capacity)
  • Method Details Link icon

    • get Link icon

      public V get(Object key)
    • put Link icon

      public V put(K key, V value)
    • clear Link icon

      public void clear()
    • onEntryRemoval Link icon

      protected boolean onEntryRemoval(K key)
      Parameters:
      key - the key of the node to test for removal and do finalization on
      Returns:
      true if removal is approved
    • cleanUp Link icon

      protected void cleanUp()