Package org.apache.druid.client
Class CacheUtil
java.lang.Object
org.apache.druid.client.CacheUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Cache.NamedKeycomputeResultLevelCacheKey(byte[] resultLevelCacheIdentifier) static Cache.NamedKeycomputeSegmentCacheKey(String segmentId, SegmentDescriptor descriptor, byte[] queryCacheKey) static <T> booleanisPopulateResultCache(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> booleanisPopulateSegmentCache(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> booleanisUseResultCache(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> booleanisUseSegmentCache(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.
-
Constructor Details
-
CacheUtil
public CacheUtil()
-
-
Method Details
-
computeResultLevelCacheKey
-
computeSegmentCacheKey
public static Cache.NamedKey computeSegmentCacheKey(String segmentId, SegmentDescriptor descriptor, byte[] queryCacheKey) -
isUseSegmentCache
public static <T> boolean isUseSegmentCache(Query<T> query, @Nullable CacheStrategy<T, Object, Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType) Returns whether the segment-level cache should be checked for a particular query.- Parameters:
query- the query to checkcacheStrategy- result ofQueryToolChest.getCacheStrategy(QueryType)on this querycacheConfig- current active cache configserverType- BROKER or DATA
-
isPopulateSegmentCache
public static <T> boolean isPopulateSegmentCache(Query<T> query, @Nullable CacheStrategy<T, Object, Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType) Returns whether the result-level cache should be populated for a particular query.- Parameters:
query- the query to checkcacheStrategy- result ofQueryToolChest.getCacheStrategy(QueryType)on this querycacheConfig- current active cache configserverType- BROKER or DATA
-
isUseResultCache
public static <T> boolean isUseResultCache(Query<T> query, @Nullable CacheStrategy<T, Object, Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType) Returns whether the result-level cache should be checked for a particular query.- Parameters:
query- the query to checkcacheStrategy- result ofQueryToolChest.getCacheStrategy(QueryType)on this querycacheConfig- current active cache configserverType- BROKER or DATA
-
isPopulateResultCache
public static <T> boolean isPopulateResultCache(Query<T> query, @Nullable CacheStrategy<T, Object, Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType) Returns whether the result-level cache should be populated for a particular query.- Parameters:
query- the query to checkcacheStrategy- result ofQueryToolChest.getCacheStrategy(QueryType)on this querycacheConfig- current active cache configserverType- BROKER or DATA
-