mirror of https://github.com/apache/druid.git
fix npe in CachingQueryRunner
This commit is contained in:
parent
c05f169171
commit
69a8723f18
|
@ -84,11 +84,16 @@ public class CachingQueryRunner<T> implements QueryRunner<T>
|
||||||
&& strategy != null
|
&& strategy != null
|
||||||
&& cacheConfig.isPopulateCache();
|
&& cacheConfig.isPopulateCache();
|
||||||
|
|
||||||
final Cache.NamedKey key = CacheUtil.computeSegmentCacheKey(
|
final Cache.NamedKey key;
|
||||||
segmentIdentifier,
|
if(strategy != null && (useCache || populateCache)) {
|
||||||
segmentDescriptor,
|
key = CacheUtil.computeSegmentCacheKey(
|
||||||
strategy.computeCacheKey(query)
|
segmentIdentifier,
|
||||||
);
|
segmentDescriptor,
|
||||||
|
strategy.computeCacheKey(query)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
key = null;
|
||||||
|
}
|
||||||
|
|
||||||
if(useCache) {
|
if(useCache) {
|
||||||
final Function cacheFn = strategy.pullFromCache();
|
final Function cacheFn = strategy.pullFromCache();
|
||||||
|
|
Loading…
Reference in New Issue