public static class Store.Cache.WeakSoftRef extends Store.Cache
SoftReference or WeakReference
Items can be removed from cache by Garbage Collector if| Modifier and Type | Class and Description |
|---|---|
protected static interface |
Store.Cache.WeakSoftRef.CacheItem |
protected static class |
Store.Cache.WeakSoftRef.CacheSoftItem<A> |
protected static class |
Store.Cache.WeakSoftRef.CacheWeakItem<A> |
Store.Cache.HardRef, Store.Cache.HashTable, Store.Cache.LRU, Store.Cache.WeakSoftRef| Modifier and Type | Field and Description |
|---|---|
protected static int |
CHECK_EVERY_N |
protected int |
counter |
protected ScheduledExecutorService |
executor |
protected long |
executorScheduledRate |
protected Store.LongObjectMap<Store.Cache.WeakSoftRef.CacheItem> |
items |
protected ReferenceQueue<Object> |
queue |
protected boolean |
useWeakRef |
cacheHitCounter, cacheMissCounter, lock, NULL| Constructor and Description |
|---|
Store.Cache.WeakSoftRef(boolean useWeakRef,
boolean disableLocks,
ScheduledExecutorService executor,
long executorScheduledRate) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close() |
protected void |
flushGCed() |
protected void |
flushGCedLocked() |
Object |
get(long recid) |
Store.Cache |
newCacheForOtherSegment() |
void |
put(long recid,
Object item) |
metricsCacheHit, metricsCacheMissprotected ReferenceQueue<Object> queue
protected Store.LongObjectMap<Store.Cache.WeakSoftRef.CacheItem> items
protected static final int CHECK_EVERY_N
protected int counter
protected final ScheduledExecutorService executor
protected final boolean useWeakRef
protected final long executorScheduledRate
public Store.Cache.WeakSoftRef(boolean useWeakRef,
boolean disableLocks,
ScheduledExecutorService executor,
long executorScheduledRate)
public Object get(long recid)
get in class Store.Cachepublic void put(long recid,
Object item)
put in class Store.Cachepublic void clear()
clear in class Store.Cachepublic void close()
close in class Store.Cachepublic Store.Cache newCacheForOtherSegment()
newCacheForOtherSegment in class Store.Cacheprotected void flushGCed()
protected void flushGCedLocked()
Copyright © 2015. All Rights Reserved.