org.exist.storage
Interface CacheManager

All Known Implementing Classes:
CollectionCacheManager, DefaultCacheManager

public interface CacheManager


Field Summary
static String BTREE_CACHE
           
static String DATA_CACHE
           
 
Method Summary
 void checkCaches()
          Called from the global major sync event to check if caches can be shrinked.
 void checkDistribution()
          Called from the global minor sync event to check if a smaller cache wants to be resized.
 void deregisterCache(Cache cache)
           
 long getCurrentSize()
           
 long getMaxSingle()
           
 long getMaxTotal()
           
 void registerCache(Cache cache)
          Register a cache, i.e.
 int requestMem(Cache cache)
          Called by a cache if it wants to grow.
 

Field Detail

BTREE_CACHE

static final String BTREE_CACHE
See Also:
Constant Field Values

DATA_CACHE

static final String DATA_CACHE
See Also:
Constant Field Values
Method Detail

registerCache

void registerCache(Cache cache)
Register a cache, i.e. put it under control of the cache manager.

Parameters:
cache -

deregisterCache

void deregisterCache(Cache cache)

requestMem

int requestMem(Cache cache)
Called by a cache if it wants to grow. The cache manager will either deny the request, for example, if there are no spare pages left, or calculate a new cache size and call the cache's Cache.resize(int) method to resize the cache. The amount of pages by which the cache will grow is determined by the cache's growthFactor: Cache.getGrowthFactor().

Parameters:
cache -
Returns:
new cache size, or -1 if no free pages available.

checkCaches

void checkCaches()
Called from the global major sync event to check if caches can be shrinked. If shrinked, the cache will be reset to the default initial cache size.


checkDistribution

void checkDistribution()
Called from the global minor sync event to check if a smaller cache wants to be resized. If a huge cache is availabe, the method might decide to shrink this cache by a certain amount to make room for the smaller cache to grow.


getMaxTotal

long getMaxTotal()

getMaxSingle

long getMaxSingle()

getCurrentSize

long getCurrentSize()


Copyright (C) Wolfgang Meier. All rights reserved.