T
- type of store handled by this evictorpublic abstract class AbstractBalancedAccessEvictor<T> extends Object implements PoolEvictor<T>
Constructor and Description |
---|
AbstractBalancedAccessEvictor() |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
byteSize(T store)
Return the size in bytes of the supplied store.
|
protected abstract long |
countSize(T store)
Return the number of mappings in the supplied store.
|
protected abstract boolean |
evict(T store,
int count,
long bytes)
Evict the specified number of bytes or the hinted number of elements from the specified store
|
boolean |
freeSpace(Collection<T> from,
long bytes)
Free at least N bytes from a collection of resources
|
protected abstract float |
hitRate(T store)
Return the hit rate for the supplied store.
|
protected abstract float |
missRate(T store)
Return the miss rate for the supplied store.
|
protected abstract boolean evict(T store, int count, long bytes)
store
- store to evict fromcount
- number of elements to evictbytes
- number of bytes to evicttrue
if the eviction succeededprotected abstract float hitRate(T store)
store
- store to queryprotected abstract float missRate(T store)
store
- store to queryprotected abstract long countSize(T store)
store
- store to sizeprotected abstract long byteSize(T store)
store
- store to sizepublic boolean freeSpace(Collection<T> from, long bytes)
freeSpace
in interface PoolEvictor<T>
from
- a collection of resources to free frombytes
- the number of bytes to free upCopyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.