Package org.apache.solr.search.stats
Class LRUStatsCache
- java.lang.Object
-
- org.apache.solr.search.stats.StatsCache
-
- org.apache.solr.search.stats.ExactStatsCache
-
- org.apache.solr.search.stats.LRUStatsCache
-
- All Implemented Interfaces:
PluginInfoInitialized
public class LRUStatsCache extends ExactStatsCache
UnlikeExactStatsCache
this implementation preserves term stats across queries in a set of LRU caches, and based on surface features of a query it determines the need to send additional RPC-s. As a result the additional RPC-s are needed much less frequently.Query terms and their stats are maintained in a set of maps. At the query front-end there will be as many maps as there are shards, each maintaining the respective shard statistics. At each shard server there is a single map that is updated with the global statistics on every request.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.search.stats.ExactStatsCache
ExactStatsCache.ExactStatsSource
-
-
Field Summary
-
Fields inherited from class org.apache.solr.search.stats.StatsCache
COL_STATS_KEY, TERM_STATS_KEY, TERMS_KEY
-
-
Constructor Summary
Constructors Constructor Description LRUStatsCache()
-
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)
StatsSource
get(SolrQueryRequest req)
Prepare localStatsSource
to provide stats information to perform local scoring (to be precise, to build a localWeight
from the query).protected Map<String,CollectionStats>
getPerShardColStats(ResponseBuilder rb, String shard)
protected TermStats
getPerShardTermStats(SolrQueryRequest req, String t, String shard)
void
init(PluginInfo info)
protected void
printStats(SolrQueryRequest req)
-
Methods inherited from class org.apache.solr.search.stats.ExactStatsCache
mergeToGlobalStats, receiveGlobalStats, retrieveStatsRequest, returnLocalStats, sendGlobalStats
-
-
-
-
Method Detail
-
get
public StatsSource get(SolrQueryRequest req)
Description copied from class:StatsCache
Prepare localStatsSource
to provide stats information to perform local scoring (to be precise, to build a localWeight
from the query).- Overrides:
get
in classExactStatsCache
- Parameters:
req
- query request- Returns:
- an instance of
StatsSource
to use in creating a queryWeight
-
init
public void init(PluginInfo info)
- Specified by:
init
in interfacePluginInfoInitialized
- Overrides:
init
in classExactStatsCache
-
addToGlobalTermStats
protected void addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
- Overrides:
addToGlobalTermStats
in classExactStatsCache
-
addToPerShardColStats
protected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
- Overrides:
addToPerShardColStats
in classExactStatsCache
-
getPerShardColStats
protected Map<String,CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard)
- Overrides:
getPerShardColStats
in classExactStatsCache
-
addToPerShardTermStats
protected void addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
- Overrides:
addToPerShardTermStats
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
-
printStats
protected void printStats(SolrQueryRequest req)
- Overrides:
printStats
in classExactStatsCache
-
-