From 19d6aec39668a8402f780bd6805dcf0246df47b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Tue, 8 Apr 2014 17:21:01 -0700 Subject: [PATCH] address code review comments --- .../src/main/java/io/druid/client/CachingQueryRunner.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/io/druid/client/CachingQueryRunner.java b/server/src/main/java/io/druid/client/CachingQueryRunner.java index aecf68dd781..2b198c2fb57 100644 --- a/server/src/main/java/io/druid/client/CachingQueryRunner.java +++ b/server/src/main/java/io/druid/client/CachingQueryRunner.java @@ -37,7 +37,6 @@ import io.druid.query.QueryRunner; import io.druid.query.QueryToolChest; import io.druid.query.SegmentDescriptor; -import javax.annotation.Nullable; import java.io.IOException; import java.util.Iterator; import java.util.List; @@ -81,7 +80,7 @@ public class CachingQueryRunner implements QueryRunner && strategy != null && cacheConfig.isPopulateCache(); - final boolean useCache = Boolean.parseBoolean(query.getContextValue(CacheConfig.USE_CACHE, "true")) + final boolean useCache = query.getContextUseCache(true) && strategy != null && cacheConfig.isPopulateCache(); @@ -139,9 +138,8 @@ public class CachingQueryRunner implements QueryRunner base.run(query), new Function() { - @Nullable @Override - public T apply(@Nullable T input) + public T apply(T input) { cacheResults.add(cacheFn.apply(input)); return input;