Package com.mckoi.database
Class DataCellCache.DCCache
- java.lang.Object
-
- com.mckoi.util.Cache
-
- com.mckoi.database.DataCellCache.DCCache
-
- Enclosing class:
- DataCellCache
private final class DataCellCache.DCCache extends Cache
This extends the 'Cache' class.
-
-
Field Summary
Fields Modifier and Type Field Description private intMAX_CACHE_SIZEThe maximum size that the cache can grow to in bytes.
-
Constructor Summary
Constructors Constructor Description DCCache(int cache_hash_size, int max_cache_size)The Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckClean()This is called whenever at Object is put into the cache.protected voidnotifyGetWalks(long total_walks, long total_get_ops)Notifies that some statistical information about the hash map has updated.protected voidnotifyWipingNode(java.lang.Object ob)Notifies that the given object has been wiped from the cache by the clean up procedure.voidsetCacheSize(int cache_size)Used to dynamically alter the size of the cache.protected booleanshouldWipeMoreNodes()Returns true if the clean-up method that periodically cleans up the cache, should clean up more elements from the cache.
-
-
-
Method Detail
-
setCacheSize
public void setCacheSize(int cache_size)
Used to dynamically alter the size of the cache. May cause a cache clean if the size is over the limit.
-
checkClean
protected void checkClean()
Description copied from class:CacheThis is called whenever at Object is put into the cache. This method should determine if the cache should be cleaned and call the clean method if appropriate.- Overrides:
checkCleanin classCache
-
shouldWipeMoreNodes
protected boolean shouldWipeMoreNodes()
Description copied from class:CacheReturns true if the clean-up method that periodically cleans up the cache, should clean up more elements from the cache.- Overrides:
shouldWipeMoreNodesin classCache
-
notifyWipingNode
protected void notifyWipingNode(java.lang.Object ob)
Description copied from class:CacheNotifies that the given object has been wiped from the cache by the clean up procedure.- Overrides:
notifyWipingNodein classCache
-
notifyGetWalks
protected void notifyGetWalks(long total_walks, long total_get_ops)Description copied from class:CacheNotifies that some statistical information about the hash map has updated. This should be used to compile statistical information about the number of walks a 'get' operation takes to retreive an entry from the hash.This method is called every 8192 gets.
- Overrides:
notifyGetWalksin classCache
-
-