|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.weborganic.bastille.cache.util.SizeEstimator
public final class SizeEstimator
A simple class to estimate the size of a cache based on previously calculated sized and the number of elements.
Method Summary | |
---|---|
boolean |
checkInMemorySample(Ehcache cache)
Check whether a new "in memory" size sample need to be re-calculated. |
boolean |
checkOnDiskSample(Ehcache cache)
Check whether a new "on disk" size sample need to be re-calculated. |
long |
estimateInMemorySize(String name,
int elements)
Estimate the "in memory" size based on previous samples. |
long |
estimateOnDiskSize(String name,
int elements)
Estimate the "on disk" size based on previous samples. |
long |
getInMemorySize(Ehcache cache)
Returns the "in memory" size from the cache. |
long |
getOnDiskSize(Ehcache cache)
Returns the "on disk" size from the cache. |
static SizeEstimator |
singleton()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SizeEstimator singleton()
public boolean checkInMemorySample(Ehcache cache)
cache
- The cache.
true
if a new sample was recalculated;
false
otherwise.public boolean checkOnDiskSample(Ehcache cache)
cache
- The cache.
true
if a new sample was recalculated;
false
otherwise.public long getInMemorySize(Ehcache cache)
This method does not indicate whether the size was calculated or estimated from a previous sample.
cache
- The cache
public long getOnDiskSize(Ehcache cache)
This method does not indicate whether the size was calculated or estimated from a previous sample.
cache
- The cache
public long estimateInMemorySize(String name, int elements)
name
- The name of the cacheelements
- The number of elements
public long estimateOnDiskSize(String name, int elements)
name
- The name of the cacheelements
- The number of elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |