Package org.apache.solr.search.stats
Class ExactSharedStatsCache
- java.lang.Object
-
- org.apache.solr.search.stats.StatsCache
-
- org.apache.solr.search.stats.ExactStatsCache
-
- org.apache.solr.search.stats.ExactSharedStatsCache
-
- All Implemented Interfaces:
PluginInfoInitialized
public class ExactSharedStatsCache extends ExactStatsCache
This class implements exact caching of statistics. It requires an additional round-trip to parse query at shard servers, and return term statistics for query terms (and collection statistics for term fields).Global statistics are accumulated in the instance of this component (with the same life-cycle as SolrSearcher), in unbounded maps. NOTE: This may lead to excessive memory usage, in which case a
LRUStatsCache
should be considered.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.search.stats.ExactStatsCache
ExactStatsCache.ExactStatsSource
-
Nested classes/interfaces inherited from class org.apache.solr.search.stats.StatsCache
StatsCache.StatsCacheMetrics
-
-
Field Summary
-
Fields inherited from class org.apache.solr.search.stats.StatsCache
COL_STATS_KEY, FIELDS_KEY, pluginInfo, statsCacheMetrics, TERM_STATS_KEY, TERMS_KEY
-
-
Constructor Summary
Constructors Constructor Description ExactSharedStatsCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addToGlobalColStats(SolrQueryRequest req, Map.Entry<String,CollectionStats> e)
protected void
addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
protected void
addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
protected void
addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
void
clear()
Clear cached statistics.protected StatsSource
doGet(SolrQueryRequest req)
protected Map<String,CollectionStats>
getPerShardColStats(ResponseBuilder rb, String shard)
protected TermStats
getPerShardTermStats(SolrQueryRequest req, String t, String shard)
protected void
printStats(SolrQueryRequest req)
-
Methods inherited from class org.apache.solr.search.stats.ExactStatsCache
doMergeToGlobalStats, doReceiveGlobalStats, doRetrieveStatsRequest, doReturnLocalStats, doSendGlobalStats
-
Methods inherited from class org.apache.solr.search.stats.StatsCache
approxCheckMissingStats, get, getCacheMetrics, init, mergeToGlobalStats, receiveGlobalStats, retrieveStatsRequest, returnLocalStats, sendGlobalStats
-
-
-
-
Method Detail
-
doGet
protected StatsSource doGet(SolrQueryRequest req)
- Overrides:
doGet
in classExactStatsCache
-
clear
public void clear()
Description copied from class:StatsCache
Clear cached statistics.- Overrides:
clear
in classStatsCache
-
addToPerShardColStats
protected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
- Overrides:
addToPerShardColStats
in classExactStatsCache
-
printStats
protected void printStats(SolrQueryRequest req)
- Overrides:
printStats
in classExactStatsCache
-
addToPerShardTermStats
protected void addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
- Overrides:
addToPerShardTermStats
in classExactStatsCache
-
getPerShardColStats
protected Map<String,CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard)
- Overrides:
getPerShardColStats
in classExactStatsCache
-
getPerShardTermStats
protected TermStats getPerShardTermStats(SolrQueryRequest req, String t, String shard)
- Overrides:
getPerShardTermStats
in classExactStatsCache
-
addToGlobalColStats
protected void addToGlobalColStats(SolrQueryRequest req, Map.Entry<String,CollectionStats> e)
- Overrides:
addToGlobalColStats
in classExactStatsCache
-
addToGlobalTermStats
protected void addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
- Overrides:
addToGlobalTermStats
in classExactStatsCache
-
-