public class ExactStatsCache extends StatsCache
Modifier and Type | Class and Description |
---|---|
protected static class |
ExactStatsCache.ExactStatsSource |
COL_STATS_KEY, TERM_STATS_KEY, TERMS_KEY
Constructor and Description |
---|
ExactStatsCache() |
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) |
void |
mergeToGlobalStats(SolrQueryRequest req,
List<ShardResponse> responses)
Process shard responses that contain partial local stats.
|
protected void |
printStats(SolrQueryRequest req) |
void |
receiveGlobalStats(SolrQueryRequest req)
Receive global stats data from the master and update a local cache of stats
with this global data.
|
ShardRequest |
retrieveStatsRequest(ResponseBuilder rb)
Creates a
ShardRequest to retrieve per-shard stats related to the
current query and the current state of the requester's StatsCache . |
void |
returnLocalStats(ResponseBuilder rb,
SolrIndexSearcher searcher)
Prepare a local (from the local shard) response to a "retrieve stats" shard
request.
|
void |
sendGlobalStats(ResponseBuilder rb,
ShardRequest outgoing)
Prepare global stats data to be sent out to shards in this request.
|
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 StatsCache
req
- query requestStatsSource
to use in creating a query
Weight
public void init(PluginInfo info)
public ShardRequest retrieveStatsRequest(ResponseBuilder rb)
StatsCache
ShardRequest
to retrieve per-shard stats related to the
current query and the current state of the requester's StatsCache
.retrieveStatsRequest
in class StatsCache
rb
- contains current requestpublic void mergeToGlobalStats(SolrQueryRequest req, List<ShardResponse> responses)
StatsCache
mergeToGlobalStats
in class StatsCache
req
- query requestresponses
- responses from shards containing local stats for each shardprotected void addToPerShardColStats(SolrQueryRequest req, String shard, Map<String,CollectionStats> colStats)
protected void printStats(SolrQueryRequest req)
protected void addToPerShardTermStats(SolrQueryRequest req, String shard, String termStatsString)
public void returnLocalStats(ResponseBuilder rb, SolrIndexSearcher searcher)
StatsCache
returnLocalStats
in class StatsCache
rb
- response buildersearcher
- current local searcherpublic void sendGlobalStats(ResponseBuilder rb, ShardRequest outgoing)
StatsCache
sendGlobalStats
in class StatsCache
rb
- response builderoutgoing
- shard request to be sentprotected Map<String,CollectionStats> getPerShardColStats(ResponseBuilder rb, String shard)
protected TermStats getPerShardTermStats(SolrQueryRequest req, String t, String shard)
public void receiveGlobalStats(SolrQueryRequest req)
StatsCache
QueryCommand
to be submitted to
the local SolrIndexSearcher
.receiveGlobalStats
in class StatsCache
req
- query request with global stats dataprotected void addToGlobalColStats(SolrQueryRequest req, Map.Entry<String,CollectionStats> e)
protected void addToGlobalTermStats(SolrQueryRequest req, Map.Entry<String,TermStats> e)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.