Package org.apache.druid.client
Class CacheUtil
- java.lang.Object
-
- org.apache.druid.client.CacheUtil
-
public class CacheUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheUtil.ServerType
-
Constructor Summary
Constructors Constructor Description CacheUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Cache.NamedKeycomputeResultLevelCacheKey(String resultLevelCacheIdentifier)static Cache.NamedKeycomputeSegmentCacheKey(String segmentId, org.apache.druid.query.SegmentDescriptor descriptor, byte[] queryCacheKey)static <T> booleanisPopulateResultCache(org.apache.druid.query.Query<T> query, org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)Returns whether the result-level cache should be populated for a particular query.static <T> booleanisPopulateSegmentCache(org.apache.druid.query.Query<T> query, org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)Returns whether the result-level cache should be populated for a particular query.static <T> booleanisUseResultCache(org.apache.druid.query.Query<T> query, org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)Returns whether the result-level cache should be checked for a particular query.static <T> booleanisUseSegmentCache(org.apache.druid.query.Query<T> query, org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.Query<T>> cacheStrategy, CacheConfig cacheConfig, CacheUtil.ServerType serverType)Returns whether the segment-level cache should be checked for a particular query.static voidpopulateResultCache(Cache cache, Cache.NamedKey key, byte[] resultBytes)
-
-
-
Method Detail
-
computeResultLevelCacheKey
public static Cache.NamedKey computeResultLevelCacheKey(String resultLevelCacheIdentifier)
-
populateResultCache
public static void populateResultCache(Cache cache, Cache.NamedKey key, byte[] resultBytes)
-
computeSegmentCacheKey
public static Cache.NamedKey computeSegmentCacheKey(String segmentId, org.apache.druid.query.SegmentDescriptor descriptor, byte[] queryCacheKey)
-
isUseSegmentCache
public static <T> boolean isUseSegmentCache(org.apache.druid.query.Query<T> query, @Nullable org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.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(org.apache.druid.query.Query<T> query, @Nullable org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.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(org.apache.druid.query.Query<T> query, @Nullable org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.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(org.apache.druid.query.Query<T> query, @Nullable org.apache.druid.query.CacheStrategy<T,Object,org.apache.druid.query.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
-
-