public interface CacheStrategy<T,CacheType,QueryType extends Query<T>>
Modifier and Type | Method and Description |
---|---|
byte[] |
computeCacheKey(QueryType query)
Computes the cache key for the given query
|
com.fasterxml.jackson.core.type.TypeReference<CacheType> |
getCacheObjectClazz()
Returns the class type of what is used in the cache
|
boolean |
isCacheable(QueryType query,
boolean willMergeRunners)
Returns the given query is cacheable or not.
|
com.google.common.base.Function<T,CacheType> |
prepareForCache()
Returns a function that converts from the QueryType's result type to something cacheable.
|
com.google.common.base.Function<CacheType,T> |
pullFromCache()
A function that does the inverse of the operation that the function prepareForCache returns
|
boolean isCacheable(QueryType query, boolean willMergeRunners)
willMergeRunners
parameter can be used for distinguishing the caller is a broker or a data node.query
- the query to be cachedwillMergeRunners
- indicates that QueryRunnerFactory.mergeRunners(ExecutorService, Iterable)
will be
called on the cached by-segment resultsbyte[] computeCacheKey(QueryType query)
query
- the query to compute a cache key forcom.fasterxml.jackson.core.type.TypeReference<CacheType> getCacheObjectClazz()
com.google.common.base.Function<T,CacheType> prepareForCache()
Copyright © 2011–2017. All rights reserved.