ca.uhn.cache.internal.impl
Class CacheCleaner

java.lang.Object
  extended byca.uhn.cache.internal.impl.CacheCleaner
All Implemented Interfaces:
ICacheCleaner

public class CacheCleaner
extends java.lang.Object
implements ICacheCleaner

Default implementation of ICacheCleaner.

Version:
$Revision: 1.1 $ updated on $Date: 2005/01/24 22:54:03 $ by $Author: bryan_tripp $
Author:
Bryan Tripp

Constructor Summary
CacheCleaner(IChunkStore theChunkStore, IChunkPurger thePurger, int theTargetSize, IQueryResultStore theItemStore, float theAgeDecrement)
           
 
Method Summary
 void evictStaleChunks()
          Removes from the cache any chunks that are older than their maximum age.
 void evictUnusedChunks()
          Removes from the cache any chunks that are unlikely to be used in the near future, according to getUnusedChunkRule().
 long getTargetSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheCleaner

public CacheCleaner(IChunkStore theChunkStore,
                    IChunkPurger thePurger,
                    int theTargetSize,
                    IQueryResultStore theItemStore,
                    float theAgeDecrement)
Parameters:
theChunkStore - chunk store cleaned by this cleaner
thePurger - a specialized interface to the same store
theTargetSize - as in getTargetSize()
theItemStore - query result store that corresponds to the chunk store
theAgeDecrement - unused chunks are evicted in blocks according to the age of last usage, and this param is the size of each block as a proportion of greatest age in the cache (.01 = 1%, i.e. chunks divided into 100 blocks)
Method Detail

getTargetSize

public long getTargetSize()
Specified by:
getTargetSize in interface ICacheCleaner
Returns:
target size of cache: if there are more records than this in the cache, less useful records will be evicted
See Also:
ICacheCleaner.getTargetSize()

evictStaleChunks

public void evictStaleChunks()
Description copied from interface: ICacheCleaner
Removes from the cache any chunks that are older than their maximum age.

Specified by:
evictStaleChunks in interface ICacheCleaner
See Also:
ICacheCleaner.evictStaleChunks()

evictUnusedChunks

public void evictUnusedChunks()
Description copied from interface: ICacheCleaner
Removes from the cache any chunks that are unlikely to be used in the near future, according to getUnusedChunkRule().

Specified by:
evictUnusedChunks in interface ICacheCleaner
See Also:
ICacheCleaner.evictUnusedChunks()


Copyright © 2004-2005 University Health Network. All Rights Reserved.