Module org.elasticsearch.server
Package org.elasticsearch.action.search
Class CCSSingleCoordinatorSearchProgressListener
java.lang.Object
org.elasticsearch.action.search.SearchProgressListener
org.elasticsearch.action.search.CCSSingleCoordinatorSearchProgressListener
Use this progress listener for cross-cluster searches where a single
coordinator is used for all clusters (minimize_roundtrips=false).
It updates state in the SearchResponse.Clusters object as the search
progresses so that the metadata required for the _clusters/details
section in the SearchResponse is accurate.
-
Field Summary
Fields inherited from class org.elasticsearch.action.search.SearchProgressListener
NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonFetchFailure(int shardIndex, SearchShardTarget shardTarget, Exception exc) Executed when a shard reports a fetch failure.voidonFetchResult(int shardIndex) Executed when a shard returns a fetch result.voidonFinalReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed once when the final reduce is created.voidonListShards(List<SearchShard> shards, List<SearchShard> skipped, SearchResponse.Clusters clusters, boolean fetchPhase, TransportSearchAction.SearchTimeProvider timeProvider) Executed when shards are ready to be queried (after can-match)voidonPartialReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed when a partial reduce is created.voidonQueryFailure(int shardIndex, SearchShardTarget shardTarget, Exception e) Executed when a shard reports a query failure.voidonQueryResult(int shardIndex, QuerySearchResult queryResult) Executed when a shard returns a query result.voidonRankFeatureFailure(int shardIndex, SearchShardTarget shardTarget, Exception exc) Executed when a shard reports a rank feature failure.voidonRankFeatureResult(int shardIndex) Executed when a shard returns a rank feature result.Methods inherited from class org.elasticsearch.action.search.SearchProgressListener
notifyFinalReduce, onClusterResponseMinimizeRoundtrips
-
Constructor Details
-
CCSSingleCoordinatorSearchProgressListener
public CCSSingleCoordinatorSearchProgressListener()
-
-
Method Details
-
onListShards
public void onListShards(List<SearchShard> shards, List<SearchShard> skipped, SearchResponse.Clusters clusters, boolean fetchPhase, TransportSearchAction.SearchTimeProvider timeProvider) Executed when shards are ready to be queried (after can-match)- Overrides:
onListShardsin classSearchProgressListener- Parameters:
shards- The list of shards to query.skipped- The list of skipped shards.clusters- The statistics for remote clusters included in the search.fetchPhase-trueif the search needs a fetch phase,falseotherwise.timeProvider- absolute and relative time provider for this search
-
onQueryResult
Executed when a shard returns a query result.- Overrides:
onQueryResultin classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider).queryResult- QuerySearchResult holding the result for a SearchShardTarget
-
onQueryFailure
Executed when a shard reports a query failure.- Overrides:
onQueryFailurein classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.e- The cause of the failure.
-
onPartialReduce
public void onPartialReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed when a partial reduce is created. The number of partial reduce can be controlled viaSearchRequest.setBatchedReduceSize(int). Note that onPartialReduce and onFinalReduce are called with cumulative data so far. For example if the first call to onPartialReduce has 5 shards, the second call will have those same 5 shards plus the new batch. onFinalReduce will see all those shards one final time.- Overrides:
onPartialReducein classSearchProgressListener- Parameters:
shards- The list of shards that are part of this reduce.totalHits- The total number of hits in this reduce.aggs- The partial result for aggregations.reducePhase- The version number for this reduce.
-
onFinalReduce
public void onFinalReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed once when the final reduce is created. Note that his will see all the shards, even if they have been passed to the onPartialReduce method already.- Overrides:
onFinalReducein classSearchProgressListener- Parameters:
shards- The list of shards that are part of this reduce.totalHits- The total number of hits in this reduce.aggs- The final result for aggregations.reducePhase- The version number for this reduce.
-
onRankFeatureResult
public void onRankFeatureResult(int shardIndex) Executed when a shard returns a rank feature result.- Overrides:
onRankFeatureResultin classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.
-
onRankFeatureFailure
Executed when a shard reports a rank feature failure.- Overrides:
onRankFeatureFailurein classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.exc- The cause of the failure.
-
onFetchResult
public void onFetchResult(int shardIndex) Executed when a shard returns a fetch result.- Overrides:
onFetchResultin classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.
-
onFetchFailure
Executed when a shard reports a fetch failure.- Overrides:
onFetchFailurein classSearchProgressListener- Parameters:
shardIndex- The index of the shard in the list provided bySearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.exc- The cause of the failure.
-