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 int
MAX_CACHE_SIZE
The 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 void
checkClean()
This is called whenever at Object is put into the cache.protected void
notifyGetWalks(long total_walks, long total_get_ops)
Notifies that some statistical information about the hash map has updated.protected void
notifyWipingNode(java.lang.Object ob)
Notifies that the given object has been wiped from the cache by the clean up procedure.void
setCacheSize(int cache_size)
Used to dynamically alter the size of the cache.protected boolean
shouldWipeMoreNodes()
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:Cache
This 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:
checkClean
in classCache
-
shouldWipeMoreNodes
protected boolean shouldWipeMoreNodes()
Description copied from class:Cache
Returns true if the clean-up method that periodically cleans up the cache, should clean up more elements from the cache.- Overrides:
shouldWipeMoreNodes
in classCache
-
notifyWipingNode
protected void notifyWipingNode(java.lang.Object ob)
Description copied from class:Cache
Notifies that the given object has been wiped from the cache by the clean up procedure.- Overrides:
notifyWipingNode
in classCache
-
notifyGetWalks
protected void notifyGetWalks(long total_walks, long total_get_ops)
Description copied from class:Cache
Notifies 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:
notifyGetWalks
in classCache
-
-