mirror of
https://github.com/apache/druid.git
synced 2025-02-17 15:35:56 +00:00
address code review comments
This commit is contained in:
parent
60b95dabad
commit
19d6aec396
@ -37,7 +37,6 @@ import io.druid.query.QueryRunner;
|
|||||||
import io.druid.query.QueryToolChest;
|
import io.druid.query.QueryToolChest;
|
||||||
import io.druid.query.SegmentDescriptor;
|
import io.druid.query.SegmentDescriptor;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -81,7 +80,7 @@ public class CachingQueryRunner<T> implements QueryRunner<T>
|
|||||||
&& strategy != null
|
&& strategy != null
|
||||||
&& cacheConfig.isPopulateCache();
|
&& cacheConfig.isPopulateCache();
|
||||||
|
|
||||||
final boolean useCache = Boolean.parseBoolean(query.getContextValue(CacheConfig.USE_CACHE, "true"))
|
final boolean useCache = query.getContextUseCache(true)
|
||||||
&& strategy != null
|
&& strategy != null
|
||||||
&& cacheConfig.isPopulateCache();
|
&& cacheConfig.isPopulateCache();
|
||||||
|
|
||||||
@ -139,9 +138,8 @@ public class CachingQueryRunner<T> implements QueryRunner<T>
|
|||||||
base.run(query),
|
base.run(query),
|
||||||
new Function<T, T>()
|
new Function<T, T>()
|
||||||
{
|
{
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public T apply(@Nullable T input)
|
public T apply(T input)
|
||||||
{
|
{
|
||||||
cacheResults.add(cacheFn.apply(input));
|
cacheResults.add(cacheFn.apply(input));
|
||||||
return input;
|
return input;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user