Class NearCache<K,V>
java.lang.Object
com.loomcache.client.cache.NearCache<K,V>
- All Implemented Interfaces:
AutoCloseable
A standalone, in-process near-cache with configurable eviction, TTL, max-idle tracking, and
periodic cleanup.
This class is independent of LoomClient's built-in near-cache; use it directly when
you want near-cache semantics in front of any arbitrary data source (not just a LoomCache map).
Configure via the nested NearCache.NearCacheConfig record. Close the instance when done to shut
down the background cleanup thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic interfacestatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()@Nullable V@Nullable NearCache.CacheEntryMetadatagetEntryMetadata(K key) getStats()voidinvalidate(K key) voidvoidvoidvoidvoidvoidshutdown()intsize()
-
Constructor Details
-
NearCache
-
-
Method Details
-
get
-
put
-
remove
-
invalidate
-
invalidateAll
public void invalidateAll() -
size
public int size() -
getStats
-
getDetailedStats
-
clearStats
public void clearStats() -
preload
-
getEvictionPolicy
-
setEvictionPolicy
-
getEntryMetadata
-
getCacheEfficiency
-
shutdown
public void shutdown() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-