ca.uhn.cache.internal
Interface IUnusedChunkRule

All Known Implementing Classes:
DefaultUnusedChunkRule

public interface IUnusedChunkRule

Determiner of how likely it is that a chunk will be used in the near future.

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

Method Summary
 long getVoguenessModifier(IChunk theChunk)
          For use with the least-recently-used (LRU) mode of cache eviction.
 

Method Detail

getVoguenessModifier

public long getVoguenessModifier(IChunk theChunk)
For use with the least-recently-used (LRU) mode of cache eviction. By default, if the cache gets too full, the least recently used chunks are evicted until the cache is small enough (LRU means chunks with last access times the farthest in the past). Sometimes this isn't optimal. For example, a chunk may be cached because it will definitly be used in the next 30 minutes, but may be evicted after 20 minutes while other single-use chunks remain cached. This method defines a modifier on last access time, to account for special circumstances. This allows us to change the LRU rule from "evict if last_access_time less than x" to "evict if (last_access_time + modifier) less than x", which is more flexible. The resulting index (i.e. last_access_time + modifier) we call vogueness.

Parameters:
theChunk - a chunk to be cached
Returns:
the time (ms) by which to shift the last access time when evaluating for eviction


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