Github user karanmehta93 commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/425#discussion_r245854871
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/query/GuidePostsCache.java ---
@@ -59,22 +59,36 @@
private final ConnectionQueryServices queryServices;
private final LoadingCache<GuidePostsKey, GuidePostsInfo> cache;
+ private final ExecutorService executor;
public GuidePostsCache(ConnectionQueryServices queryServices,
Configuration config) {
this.queryServices = Objects.requireNonNull(queryServices);
+
+ // The size of the thread pool used for refreshing cached table
stats
+ final int statsCacheThreadPoolSize = config.getInt(
+ QueryServices.STATS_CACHE_THREAD_POOL_SIZE,
+ QueryServicesOptions.DEFAULT_STATS_CACHE_THREAD_POOL_SIZE);
+
+ executor = Executors.newFixedThreadPool(statsCacheThreadPoolSize);
--- End diff --
On a second thought, do we know why do we build the cache even when stats
are disabled? Can we skip it or would it result in NPE's all around?
---