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