Package org.eclipse.rdf4j.sail.nativerdf
Class ConcurrentCache<K,V>
java.lang.Object
org.eclipse.rdf4j.sail.nativerdf.ConcurrentCache<K,V>
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
.- Author:
- Oleg Mirzov
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
cache
-
-
Constructor Details
-
ConcurrentCache
public ConcurrentCache(int capacity)
-
-
Method Details
-
get
-
put
-
clear
public void clear() -
onEntryRemoval
- Parameters:
key
- the key of the node to test for removal and do finalization on- Returns:
- true if removal is approved
-
cleanUp
protected void cleanUp()
-