|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.cache.HardReferenceGlobalLRURecyclerExplicitDeleteRequired<K,V>
K - The generic type of the key.V - The generic type of the value.public class HardReferenceGlobalLRURecyclerExplicitDeleteRequired<K,V>
A canonicalizing collection of strongly held hard reference hash maps backed
by a single Least Recently Used (LRU) ordering over entries. This is used to
impose a shared LRU policy on the cache for a set of IRawStores. The
LRU Entry is recycled on eviction as the MRU Entry, which
requires tests against the inner LRUCacheImpl's map to be made while
holding the lock. This allows us to use a LinkedHashMap, which has a
faster iterator, but requiring the lock to test the inner cache limits
concurrency and has been observed to limit throughput by about 10%.
IDataRecordAccess since we can not measure the bytesInMemory
for those objects and hence the LRU eviction policy will not account
for their memory footprint?| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.bigdata.cache.IGlobalLRU |
|---|
IGlobalLRU.IGlobalLRUCounters, IGlobalLRU.ILRUCache<K,V> |
| Constructor Summary | |
|---|---|
HardReferenceGlobalLRURecyclerExplicitDeleteRequired(long maximumBytesInMemory,
long minCleared,
int minimumCacheSetCapacity,
int initialCacheCapacity,
float loadFactor)
|
|
| Method Summary | |
|---|---|
void |
deleteCache(UUID uuid)
Remove the cache for the IRawStore from the set of caches
maintained by this class and clear any entries in that cache. |
void |
discardAllCaches()
Clear all per- IRawStore cache instances. |
long |
getBytesInMemory()
The #of bytes in memory across all cache instances. |
IGlobalLRU.ILRUCache<K,V> |
getCache(UUID uuid,
IAddressManager am)
An canonicalizing factory for cache instances supporting random access to decompressed IDataRecords, higher-level data structures wrapping
those decompressed data records (INodeData and ILeafData
), or objects deserialized from those IDataRecords. |
int |
getCacheSetSize()
Return the #of cache instances. |
CounterSet |
getCounterSet()
The counters for the global LRU. |
long |
getEvictionByteCount()
|
long |
getEvictionCount()
The #of records which have been evicted from memory to date across all cache instances. |
int |
getRecordCount()
The #of records in memory across all cache instances. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HardReferenceGlobalLRURecyclerExplicitDeleteRequired(long maximumBytesInMemory,
long minCleared,
int minimumCacheSetCapacity,
int initialCacheCapacity,
float loadFactor)
maximumBytesInMemory - The maximum bytes in memory for the cached records across all
cache instances.minCleared - The minimum number of bytes that will be cleared when evicting
the LRU entry. When zero, only as many records will be evicted
as are necessary to bring the bytes in memory below the
configured maximum. When greater than zero, "batch" evictions
can be performed. For example, several MB worth of records can
be evicted each time the LRU is at its maximum capacity.minimumCacheSetCapacity - The #of per-IRawStore ILRUCache instances that
will be maintained by hard references unless their cache is
explicitly discarded.initialCacheCapacity - The initial capacity of each new cache instance.loadFactor - The load factor for the cache instances.| Method Detail |
|---|
public IGlobalLRU.ILRUCache<K,V> getCache(UUID uuid,
IAddressManager am)
IGlobalLRUIDataRecords, higher-level data structures wrapping
those decompressed data records (INodeData and ILeafData
), or objects deserialized from those IDataRecords.
getCache in interface IGlobalLRU<K,V>uuid - The store's UUID.am - The IAddressManager for that store (optional, but used
to compute the bytes on disk for record and hence highly
desired).
AbstractBTree.readNodeOrLeaf(long),
IndexSegmentStore.reopen(),
LRUNexus.getCache(IRawStore)public int getRecordCount()
IHardReferenceGlobalLRU
getRecordCount in interface IHardReferenceGlobalLRU<K,V>public long getEvictionCount()
IHardReferenceGlobalLRU
getEvictionCount in interface IHardReferenceGlobalLRU<K,V>public long getEvictionByteCount()
public long getBytesInMemory()
IHardReferenceGlobalLRU
getBytesInMemory in interface IHardReferenceGlobalLRU<K,V>public int getCacheSetSize()
IHardReferenceGlobalLRU
getCacheSetSize in interface IHardReferenceGlobalLRU<K,V>public void deleteCache(UUID uuid)
IGlobalLRUIRawStore from the set of caches
maintained by this class and clear any entries in that cache. This method
SHOULD be used when the persistent resources for the store are deleted.
It SHOULD NOT be used if a store is simply closed in a context when the
store COULD be re-opened. In such cases, the cache for that store will be
automatically released after it has become only weakly reachable.
deleteCache in interface IGlobalLRU<K,V>uuid - The store's UUID.IRawStore.destroy(),
IRawStore.deleteResources()public void discardAllCaches()
IGlobalLRUIRawStore cache instances. This may be used if all
bigdata instances in the JVM are closed, but SHOULD NOT be invoked if you
are just closing some IRawStore.
discardAllCaches in interface IGlobalLRU<K,V>public CounterSet getCounterSet()
IGlobalLRU
getCounterSet in interface IGlobalLRU<K,V>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||