org.elasticsearch.action.search.type
Class TransportSearchTypeAction.BaseAsyncAction<FirstResult extends SearchPhaseResult>

java.lang.Object
  extended by org.elasticsearch.action.search.type.TransportSearchTypeAction.BaseAsyncAction<FirstResult>
Enclosing class:
TransportSearchTypeAction

protected abstract class TransportSearchTypeAction.BaseAsyncAction<FirstResult extends SearchPhaseResult>
extends java.lang.Object


Field Summary
protected  ClusterState clusterState
           
protected  int expectedSuccessfulOps
           
protected  ActionListener<SearchResponse> listener
           
protected  DiscoveryNodes nodes
           
protected  SearchRequest request
           
protected  java.util.Collection<ShardSearchFailure> shardFailures
           
protected  ShardDoc[] sortedShardList
           
protected  long startTime
           
protected  java.util.concurrent.atomic.AtomicInteger successulOps
           
 
Constructor Summary
protected TransportSearchTypeAction.BaseAsyncAction(SearchRequest request, ActionListener<SearchResponse> listener)
           
 
Method Summary
protected  ShardSearchFailure[] buildShardFailures()
          Builds the shard failures, and releases the cache (meaning this should only be called once!).
protected  long buildTookInMillis()
          Builds how long it took to execute the search.
protected abstract  java.lang.String firstPhaseName()
           
protected abstract  void moveToSecondPhase()
           
protected abstract  void processFirstPhaseResult(ShardRouting shard, FirstResult result)
           
protected  void releaseIrrelevantSearchContexts(java.util.Map<SearchShardTarget,QuerySearchResultProvider> queryResults, java.util.Map<SearchShardTarget,ExtTIntArrayList> docIdsToLoad)
          Releases shard targets that are not used in the docsIdsToLoad.
protected abstract  void sendExecuteFirstPhase(DiscoveryNode node, InternalSearchRequest request, SearchServiceListener<FirstResult> listener)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listener

protected final ActionListener<SearchResponse> listener

request

protected final SearchRequest request

clusterState

protected final ClusterState clusterState

nodes

protected final DiscoveryNodes nodes

expectedSuccessfulOps

protected final int expectedSuccessfulOps

successulOps

protected final java.util.concurrent.atomic.AtomicInteger successulOps

shardFailures

protected final java.util.Collection<ShardSearchFailure> shardFailures

sortedShardList

protected volatile ShardDoc[] sortedShardList

startTime

protected final long startTime
Constructor Detail

TransportSearchTypeAction.BaseAsyncAction

protected TransportSearchTypeAction.BaseAsyncAction(SearchRequest request,
                                                    ActionListener<SearchResponse> listener)
Method Detail

start

public void start()

buildTookInMillis

protected final long buildTookInMillis()
Builds how long it took to execute the search.


buildShardFailures

protected final ShardSearchFailure[] buildShardFailures()
Builds the shard failures, and releases the cache (meaning this should only be called once!).


releaseIrrelevantSearchContexts

protected void releaseIrrelevantSearchContexts(java.util.Map<SearchShardTarget,QuerySearchResultProvider> queryResults,
                                               java.util.Map<SearchShardTarget,ExtTIntArrayList> docIdsToLoad)
Releases shard targets that are not used in the docsIdsToLoad.


sendExecuteFirstPhase

protected abstract void sendExecuteFirstPhase(DiscoveryNode node,
                                              InternalSearchRequest request,
                                              SearchServiceListener<FirstResult> listener)

processFirstPhaseResult

protected abstract void processFirstPhaseResult(ShardRouting shard,
                                                FirstResult result)

moveToSecondPhase

protected abstract void moveToSecondPhase()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

firstPhaseName

protected abstract java.lang.String firstPhaseName()