Package org.apache.solr.search.stats
Class ExactStatsCache
java.lang.Object
org.apache.solr.search.stats.StatsCache
org.apache.solr.search.stats.ExactStatsCache
- All Implemented Interfaces:
AutoCloseable,SolrInfoBean,SolrMetricProducer,PluginInfoInitialized
- Direct Known Subclasses:
ExactSharedStatsCache,LRUStatsCache
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 cached in the current request's context and discarded once the processing of the current request is complete. There's no support for longer-term caching, and each request needs to build the global statistics from scratch, even for repeating queries.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.solr.search.stats.StatsCache
StatsCache.StatsCacheMetricsNested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group -
Field Summary
Fields inherited from class org.apache.solr.search.stats.StatsCache
COL_STATS_KEY, FIELDS_KEY, pluginInfo, statsCacheMetrics, TERM_STATS_KEY, TERMS_KEYFields inherited from interface org.apache.solr.metrics.SolrMetricProducer
CATEGORY_ATTR, HANDLER_ATTR, NAME_ATTR, OPERATION_ATTR, PLUGIN_NAME_ATTR, RESULT_ATTR, TYPE_ATTR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidaddToPerShardColStats(SolrQueryRequest req, String shard, Map<String, CollectionStats> colStats) protected voidaddToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString) protected StatsSourcedoGet(SolrQueryRequest req) protected voiddoMergeToGlobalStats(SolrQueryRequest req, List<ShardResponse> responses) protected voidprotected ShardRequestprotected voiddoReturnLocalStats(ResponseBuilder rb, SolrIndexSearcher searcher) protected voiddoSendGlobalStats(ResponseBuilder rb, ShardRequest outgoing) protected Map<String, CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard) protected TermStatsgetPerShardTermStats(SolrQueryRequest req, String t, String shard) protected voidMethods inherited from class org.apache.solr.search.stats.StatsCache
approxCheckMissingStats, clear, close, get, getCacheMetrics, getCategory, getDescription, getName, getSolrMetricsContext, init, initializeMetrics, mergeToGlobalStats, receiveGlobalStats, retrieveStatsRequest, returnLocalStats, sendGlobalStats
-
Constructor Details
-
ExactStatsCache
public ExactStatsCache()
-
-
Method Details
-
doGet
- Specified by:
doGetin classStatsCache
-
doRetrieveStatsRequest
- Specified by:
doRetrieveStatsRequestin classStatsCache
-
doMergeToGlobalStats
- Specified by:
doMergeToGlobalStatsin classStatsCache
-
addToPerShardColStats
protected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String, CollectionStats> colStats) -
printStats
-
addToPerShardTermStats
-
doReturnLocalStats
- Specified by:
doReturnLocalStatsin classStatsCache
-
doSendGlobalStats
- Specified by:
doSendGlobalStatsin classStatsCache
-
getPerShardColStats
-
getPerShardTermStats
-
doReceiveGlobalStats
- Specified by:
doReceiveGlobalStatsin classStatsCache
-
addToGlobalColStats
-
addToGlobalTermStats
-