|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.cache.StoreAndAddressLRUCache<V>
public class StoreAndAddressLRUCache<V>
Global LRU implementation based on a single map whose keys include both the
IRawStore.getUUID() and the long addr of the record
within the store.
HardReferenceGlobalLRU and this
class which uses a single ConcurrentHashMap but also maintains
the linked-list LRU ordering.| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.bigdata.cache.IGlobalLRU |
|---|
IGlobalLRU.IGlobalLRUCounters, IGlobalLRU.ILRUCache<K,V> |
| Constructor Summary | |
|---|---|
StoreAndAddressLRUCache(long maximumBytesInMemory,
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()
Removes all entries from the cache and the backing LRU for all IRawStores. |
IGlobalLRU.ILRUCache<Long,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. |
CounterSet |
getCounterSet()
The counters for the global LRU. |
int |
size()
Return the #of entries in the backing LRU across all IRawStores. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StoreAndAddressLRUCache(long maximumBytesInMemory,
int minimumCacheSetCapacity,
int initialCacheCapacity,
float loadFactor)
maximumBytesInMemory - The maximum bytes in memory for the cached records across all
cache instances.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 (in fact, a
single map is shared by all cache instances - the cache
instances are just logical views onto the shared map).loadFactor - The load factor for the cache instances.| Method Detail |
|---|
public int size()
IRawStores.
public IGlobalLRU.ILRUCache<Long,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<Long,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 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<Long,V>uuid - The store's UUID.IRawStore.destroy(),
IRawStore.deleteResources()public void discardAllCaches()
IRawStores.
discardAllCaches in interface IGlobalLRU<Long,V>public CounterSet getCounterSet()
IGlobalLRU
getCounterSet in interface IGlobalLRU<Long,V>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||