ehcache

net.sf.ehcache.pool.impl
Class BalancedAccessOnDiskPoolEvictor

java.lang.Object
  extended by net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor<PoolableStore>
      extended by net.sf.ehcache.pool.impl.BalancedAccessOnDiskPoolEvictor
All Implemented Interfaces:
PoolEvictor<PoolableStore>

public class BalancedAccessOnDiskPoolEvictor
extends AbstractBalancedAccessEvictor<PoolableStore>

Balanced access evictor that makes on-disk eviction decisions.

Author:
Chris Dennis

Constructor Summary
BalancedAccessOnDiskPoolEvictor()
           
 
Method Summary
protected  long byteSize(PoolableStore store)
          Return the size in bytes of the supplied store.
protected  long countSize(PoolableStore store)
          Return the number of mappings in the supplied store.
protected  boolean evict(PoolableStore store, int count, long size)
          Evict the specified number of bytes or the hinted number of elements from the specified store
protected  float hitRate(PoolableStore store)
          Return the hit rate for the supplied store.
protected  float missRate(PoolableStore store)
          Return the miss rate for the supplied store.
 
Methods inherited from class net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor
freeSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BalancedAccessOnDiskPoolEvictor

public BalancedAccessOnDiskPoolEvictor()
Method Detail

evict

protected boolean evict(PoolableStore store,
                        int count,
                        long size)
Evict the specified number of bytes or the hinted number of elements from the specified store

Specified by:
evict in class AbstractBalancedAccessEvictor<PoolableStore>
Parameters:
store - store to evict from
count - number of elements to evict
size - number of bytes to evict
Returns:
true if the eviction succeeded

countSize

protected long countSize(PoolableStore store)
Return the number of mappings in the supplied store.

Specified by:
countSize in class AbstractBalancedAccessEvictor<PoolableStore>
Parameters:
store - store to size
Returns:
mapping count

byteSize

protected long byteSize(PoolableStore store)
Return the size in bytes of the supplied store.

Specified by:
byteSize in class AbstractBalancedAccessEvictor<PoolableStore>
Parameters:
store - store to size
Returns:
size in bytes

hitRate

protected float hitRate(PoolableStore store)
Return the hit rate for the supplied store.

Specified by:
hitRate in class AbstractBalancedAccessEvictor<PoolableStore>
Parameters:
store - store to query
Returns:
hit rate

missRate

protected float missRate(PoolableStore store)
Return the miss rate for the supplied store.

Specified by:
missRate in class AbstractBalancedAccessEvictor<PoolableStore>
Parameters:
store - store to query
Returns:
miss rate

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.