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.ExactStatsSource
COL_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, sendGlobalStats
public StatsSource get(SolrQueryRequest req)
StatsCache
StatsSource
to provide stats information to perform
local scoring (to be precise, to build a local Weight
from the
query).get
in class ExactStatsCache
req
- query requestStatsSource
to use in creating a query
Weight
public void init(PluginInfo info)
init
in interface PluginInfoInitialized
init
in class ExactStatsCache
protected void addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
addToGlobalTermStats
in class ExactStatsCache
protected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
addToPerShardColStats
in class ExactStatsCache
protected Map<String,CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard)
getPerShardColStats
in class ExactStatsCache
protected void addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
addToPerShardTermStats
in class ExactStatsCache
protected TermStats getPerShardTermStats(SolrQueryRequest req, String t, String shard)
getPerShardTermStats
in class ExactStatsCache
protected void addToGlobalColStats(SolrQueryRequest req, Map.Entry<String,CollectionStats> e)
addToGlobalColStats
in class ExactStatsCache
protected void printStats(SolrQueryRequest req)
printStats
in class ExactStatsCache
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.