|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.cache.HardReferenceGlobalLRU<K,V>
K - The generic type of the key.V - The generic type of the value.
public class HardReferenceGlobalLRU<K,V>
A canonicalizing collection of weakly 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. This
implementation DOES NOT recycle the LRU Entry when it is evicted and
therefore DOES NOT require us to obtain the lock before testing the inner
LRUCacheImpl's map. In order to allow concurrent tests on that map, a
ConcurrentHashMap is used. This allows higher concurrency on
LRUCacheImpl#get(Object)l, but trades off by having a slower
iterator. When compared to the HardReferenceGlobalLRURecycler, this
implementation has approximately 10% higher throughput.
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 | |
|---|---|
HardReferenceGlobalLRU(long maximumBytesInMemory,
int minimumCacheSetCapacity,
int initialCacheCapacity,
float loadFactor)
Deprecated. |
|
HardReferenceGlobalLRU(LRUNexus.CacheSettings s)
Deprecated. The designated constructor used by LRUNexus.CacheSettings. |
|
| Method Summary | |
|---|---|
void |
deleteCache(UUID uuid)
Deprecated. Remove the cache for the IRawStore from the set of caches
maintained by this class and clear any entries in that cache. |
void |
discardAllCaches()
Deprecated. Clear all per- IRawStore cache instances. |
long |
getBytesInMemory()
Deprecated. The #of bytes in memory across all cache instances. |
long |
getBytesOnDisk()
Deprecated. The #of bytes on the disk for the records in memory across all cache instances. |
IGlobalLRU.ILRUCache<K,V> |
getCache(UUID uuid,
IAddressManager am)
Deprecated. Canonicalizing mapping and factory for a per- IRawStore cache
instance. |
int |
getCacheSetSize()
Deprecated. Return the #of cache instances. |
CounterSet |
getCounterSet()
Deprecated. The counters for the global LRU. |
long |
getEvictionCount()
Deprecated. The #of records which have been evicted from memory to date across all cache instances. |
long |
getMaximumBytesInMemory()
Deprecated. The configured value for the maximum #of bytes in memory across all cache instances. |
int |
getRecordCount()
Deprecated. The #of records in memory across all cache instances. |
String |
toString()
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HardReferenceGlobalLRU(LRUNexus.CacheSettings s)
LRUNexus.CacheSettings.
s - The LRUNexus.CacheSettings.
public HardReferenceGlobalLRU(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.loadFactor - The load factor for the cache instances.| Method Detail |
|---|
public IGlobalLRU.ILRUCache<K,V> getCache(UUID uuid,
IAddressManager am)
IRawStore cache
instance.
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()
IGlobalLRU
getRecordCount in interface IGlobalLRU<K,V>public long getEvictionCount()
IGlobalLRU
getEvictionCount in interface IGlobalLRU<K,V>public long getBytesOnDisk()
IGlobalLRU
getBytesOnDisk in interface IGlobalLRU<K,V>public long getBytesInMemory()
IGlobalLRU
getBytesInMemory in interface IGlobalLRU<K,V>public long getMaximumBytesInMemory()
IGlobalLRU
getMaximumBytesInMemory in interface IGlobalLRU<K,V>public int getCacheSetSize()
IGlobalLRU
getCacheSetSize in interface IGlobalLRU<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. The method DOES NOT guarantee consistency if
there are concurrent requests against that cache instance.
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. The method DOES NOT guarantee
consistency if there are concurrent requests against the
IGlobalLRU.
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 | |||||||||