Package io.ebean.cache
Interface ServerCache
public interface ServerCache
Represents part of the "L2" server side cache.
This is used to cache beans or query results (bean collections).
There are 2 ServerCache's for each bean type. One is used as the 'bean cache' which holds beans of a given type. The other is the 'query cache' holding query results for a given type.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all entries from the cache.Return the value given the key.Get values for many keys.intDeprecated.getStatistics(boolean reset) Deprecated.default inthitRatio()Return the hit ratio the cache is currently getting.voidPut the value in the cache with a given id.default voidPut all the values in the cache.voidRemove a entry from the cache given its id.default voidRemove the entries from the cache given the id values.intsize()Return the number of entries in the cache.default ServerCacheStatisticsstatistics(boolean reset) Return statistics for the cache.default voidvisit(MetricVisitor visitor) Visit the metrics for the cache.
-
Method Details
-
getAll
Get values for many keys. -
get
Return the value given the key. -
putAll
Put all the values in the cache. -
put
Put the value in the cache with a given id. -
removeAll
Remove the entries from the cache given the id values. -
remove
Remove a entry from the cache given its id. -
clear
void clear()Clear all entries from the cache. -
size
int size()Return the number of entries in the cache. -
hitRatio
Return the hit ratio the cache is currently getting. -
getHitRatio
Deprecated.Deprecated migrate to hitRatio(). -
statistics
Return statistics for the cache.- Parameters:
reset- if true the statistics are reset.
-
getStatistics
Deprecated.Deprecated migrate to statistics(). -
visit
Visit the metrics for the cache.
-