public class LRUStatsCache extends ExactStatsCache
ExactStatsCache 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.
ExactStatsCache.ExactStatsSourceCOL_STATS_KEY, TERM_STATS_KEY, TERMS_KEY| Constructor and Description |
|---|
LRUStatsCache() |
| Modifier and Type | Method and 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 local
StatsSource to provide stats information to perform
local scoring (to be precise, to build a local Weight 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) |
mergeToGlobalStats, receiveGlobalStats, retrieveStatsRequest, returnLocalStats, sendGlobalStatspublic StatsSource get(SolrQueryRequest req)
StatsCacheStatsSource to provide stats information to perform
local scoring (to be precise, to build a local Weight from the
query).get in class ExactStatsCachereq - query requestStatsSource to use in creating a query
Weightpublic void init(PluginInfo info)
init in interface PluginInfoInitializedinit in class ExactStatsCacheprotected void addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
addToGlobalTermStats in class ExactStatsCacheprotected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
addToPerShardColStats in class ExactStatsCacheprotected Map<String,CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard)
getPerShardColStats in class ExactStatsCacheprotected void addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
addToPerShardTermStats in class ExactStatsCacheprotected TermStats getPerShardTermStats(SolrQueryRequest req, String t, String shard)
getPerShardTermStats in class ExactStatsCacheprotected void addToGlobalColStats(SolrQueryRequest req, Map.Entry<String,CollectionStats> e)
addToGlobalColStats in class ExactStatsCacheprotected void printStats(SolrQueryRequest req)
printStats in class ExactStatsCacheCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.