public class CacheUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CacheUtil.ServerType |
| Constructor and Description |
|---|
CacheUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Cache.NamedKey |
computeResultLevelCacheKey(String resultLevelCacheIdentifier) |
static Cache.NamedKey |
computeSegmentCacheKey(String segmentId,
SegmentDescriptor descriptor,
byte[] queryCacheKey) |
static <T> boolean |
isPopulateResultCache(Query<T> query,
CacheStrategy<T,Object,Query<T>> cacheStrategy,
CacheConfig cacheConfig,
CacheUtil.ServerType serverType)
Returns whether the result-level cache should be populated for a particular query.
|
static <T> boolean |
isPopulateSegmentCache(Query<T> query,
CacheStrategy<T,Object,Query<T>> cacheStrategy,
CacheConfig cacheConfig,
CacheUtil.ServerType serverType)
Returns whether the result-level cache should be populated for a particular query.
|
static <T> boolean |
isUseResultCache(Query<T> query,
CacheStrategy<T,Object,Query<T>> cacheStrategy,
CacheConfig cacheConfig,
CacheUtil.ServerType serverType)
Returns whether the result-level cache should be checked for a particular query.
|
static <T> boolean |
isUseSegmentCache(Query<T> query,
CacheStrategy<T,Object,Query<T>> cacheStrategy,
CacheConfig cacheConfig,
CacheUtil.ServerType serverType)
Returns whether the segment-level cache should be checked for a particular query.
|
static void |
populateResultCache(Cache cache,
Cache.NamedKey key,
byte[] resultBytes) |
public static Cache.NamedKey computeResultLevelCacheKey(String resultLevelCacheIdentifier)
public static void populateResultCache(Cache cache, Cache.NamedKey key, byte[] resultBytes)
public static Cache.NamedKey computeSegmentCacheKey(String segmentId, SegmentDescriptor descriptor, byte[] queryCacheKey)
public static <T> boolean isUseSegmentCache(Query<T> query, @Nullable CacheStrategy<T,Object,Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)
query - the query to checkcacheStrategy - result of QueryToolChest.getCacheStrategy(QueryType) on this querycacheConfig - current active cache configserverType - BROKER or DATApublic static <T> boolean isPopulateSegmentCache(Query<T> query, @Nullable CacheStrategy<T,Object,Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)
query - the query to checkcacheStrategy - result of QueryToolChest.getCacheStrategy(QueryType) on this querycacheConfig - current active cache configserverType - BROKER or DATApublic static <T> boolean isUseResultCache(Query<T> query, @Nullable CacheStrategy<T,Object,Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)
query - the query to checkcacheStrategy - result of QueryToolChest.getCacheStrategy(QueryType) on this querycacheConfig - current active cache configserverType - BROKER or DATApublic static <T> boolean isPopulateResultCache(Query<T> query, @Nullable CacheStrategy<T,Object,Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)
query - the query to checkcacheStrategy - result of QueryToolChest.getCacheStrategy(QueryType) on this querycacheConfig - current active cache configserverType - BROKER or DATACopyright © 2011–2023 The Apache Software Foundation. All rights reserved.