org.exist.collections
Class CollectionCache
java.lang.Object
org.exist.storage.cache.LRUCache
org.exist.collections.CollectionCache
- All Implemented Interfaces:
- Cache
public class CollectionCache
- extends LRUCache
Global cache for Collection
objects. The
cache is owned by CollectionStore
. It is not
synchronized. Thus a lock should be obtained on the collection store before
accessing the cache.
- Author:
- wolf
Fields inherited from interface org.exist.storage.cache.Cache |
LOG |
Methods inherited from class org.exist.storage.cache.LRUCache |
add, add, flush, get, get, getBuffers, getFails, getFileName, getFirst, getGrowthFactor, getHits, getLoad, getThrashing, getType, getUsedBuffers, hasDirtyItems, setCacheManager, setFileName |
CollectionCache
public CollectionCache(BrokerPool pool,
int blockBuffers,
double growthThreshold)
add
public void add(Collection collection)
add
public void add(Collection collection,
int initialRefCount)
get
public Collection get(Collection collection)
get
public Collection get(XmldbURI name)
remove
public void remove(Cacheable item)
- Description copied from interface:
Cache
- Remove an item from the cache.
- Specified by:
remove
in interface Cache
- Overrides:
remove
in class LRUCache
getRealSize
public int getRealSize()
- Compute and return the in-memory size of all collections
currently contained in this cache.
- Returns:
- in-memory size in bytes.
- See Also:
CollectionCacheManager
resize
public void resize(int newSize)
- Description copied from interface:
Cache
- Resize the cache. This method is called by the
DefaultCacheManager
. The newSize parameter
can either be larger or smaller than the current
cache size.
- Specified by:
resize
in interface Cache
- Overrides:
resize
in class LRUCache
- Parameters:
newSize
- the new size of the cache.
Copyright (C) Wolfgang Meier. All rights reserved.