karanmehta93 commented on a change in pull request #425: PHOENIX-5069 please go
to JIRA to see the detailed design document attached.
URL: https://github.com/apache/phoenix/pull/425#discussion_r246153437
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/GuidePostsCache.java
##########
@@ -85,39 +106,46 @@ public GuidePostsCache(ConnectionQueryServices
queryServices, Configuration conf
})
// Log removals at TRACE for debugging
.removalListener(new PhoenixStatsCacheRemovalListener())
- // Automatically load the cache when entries are missing
- .build(isStatsEnabled ? new StatsLoader() : new
EmptyStatsLoader());
+ // Automatically load the cache when entries need to be
refreshed
+ .build(cacheLoader);
}
/**
- * {@link CacheLoader} implementation for the Phoenix Table Stats cache.
+ * {@link PhoenixStatsLoader} implementation for the Stats Loader.
*/
- protected class StatsLoader extends CacheLoader<GuidePostsKey,
GuidePostsInfo> {
+ protected class StatsLoaderImpl implements PhoenixStatsLoader {
@Override
- public GuidePostsInfo load(GuidePostsKey statsKey) throws Exception {
+ public boolean needsLoad() {
+ // Whenever it's called, we try to load stats from stats table
Review comment:
nit: Put a TODO here describing how we would use in future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services