|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.egothor.cache.CachedGroup
public class CachedGroup
Represents a cache of optionally paged query results.
Constructor Summary | |
---|---|
CachedGroup(Cache<CachedQuery,CachedResult> cache)
Constructor for the CachedGroup object. |
|
CachedGroup(Cache<CachedQuery,CachedResult> cache,
boolean cacheMetadata)
Constructor for the CachedGroup object. |
|
CachedGroup(Cache<CachedQuery,CachedResult> cache,
int pageSize)
Constructor for the CachedGroup object. |
|
CachedGroup(Cache<CachedQuery,CachedResult> cache,
int pageSize,
boolean cacheMetadata)
Constructor for the CachedGroup object. |
Method Summary | |
---|---|
boolean |
cachingMetadata()
Checks whether this cache should cache also document metadata. |
boolean |
containsKey(CachedQuery key)
Checks whether the specified query is cached. |
CachedResult |
get(CachedQuery key)
Gets the result associated with the specified query from the cache if the query is cached, or the result returned by the resolver. |
Cache<CachedQuery,CachedResult> |
getCache()
Gets the actual cache used for storing query results. |
float |
hitRatio()
Returns the hits/requests ratio in percents. |
long |
hits()
Returns the number of all hits. |
boolean |
isPaged()
Checks whether this cache uses paged query results. |
long |
misses()
Returns the number of all misses. |
int |
pageSize()
Return the capacity of query result page. |
CachedResult |
put(CachedQuery key,
CachedResult value)
Adds a new result for the specified query to the cache. |
CachedResult |
remove(CachedQuery key)
Removes the specified query and its result from the cache. |
long |
requests()
Returns the number of all submitted requests |
void |
resetCounters()
Sets hits and misses counters to zero. |
int |
size()
Returns the number of cached query result. |
CachedResult |
update(CachedQuery key,
CachedResult value)
Updates the result associated with the specified query in the cache if a result exists for the query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachedGroup(Cache<CachedQuery,CachedResult> cache)
cache
- actual cache used for storing query resultspublic CachedGroup(Cache<CachedQuery,CachedResult> cache, int pageSize)
cache
- actual cache used for storing query resultspageSize
- maximum size of a pagepublic CachedGroup(Cache<CachedQuery,CachedResult> cache, boolean cacheMetadata)
cache
- actual cache used for storing query resultscacheMetadata
- whether we want do cache also documents with metadatapublic CachedGroup(Cache<CachedQuery,CachedResult> cache, int pageSize, boolean cacheMetadata)
cache
- actual cache used for storing query resultspageSize
- maximum size of a pagecacheMetadata
- whether we want do cache also documents with metadataMethod Detail |
---|
public CachedResult put(CachedQuery key, CachedResult value)
key
- query to add to the cachevalue
- result to map the query to
public CachedResult get(CachedQuery key)
key
- query to get the result for
public CachedResult remove(CachedQuery key)
key
- query to remove from the cache.
public CachedResult update(CachedQuery key, CachedResult value)
key
- query to change the result forvalue
- new result associated with the key
public boolean containsKey(CachedQuery key)
key
- query to check
public boolean isPaged()
public boolean cachingMetadata()
public int pageSize()
public Cache<CachedQuery,CachedResult> getCache()
public long hits()
public long misses()
public long requests()
public float hitRatio()
public void resetCounters()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |