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  int expectedSuccessfulOps
           
protected  int expectedTotalOps
           
protected  ActionListener<SearchResponse> listener
           
protected  DiscoveryNodes nodes
           
protected  SearchRequest request
           
protected  java.util.Collection<ShardSearchFailure> shardFailures
           
protected  GroupShardsIterator shardsIts
           
protected  ShardDoc[] sortedShardList
           
protected  java.util.concurrent.atomic.AtomicInteger successulOps
           
protected  java.util.concurrent.atomic.AtomicInteger totalOps
           
 
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 abstract  java.lang.String firstPhaseName()
           
protected  void invokeListener(SearchResponse response)
           
protected  void invokeListener(java.lang.Throwable t)
           
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

shardsIts

protected final GroupShardsIterator shardsIts

request

protected final SearchRequest request

nodes

protected final DiscoveryNodes nodes

expectedSuccessfulOps

protected final int expectedSuccessfulOps

expectedTotalOps

protected final int expectedTotalOps

successulOps

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

totalOps

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

shardFailures

protected final java.util.Collection<ShardSearchFailure> shardFailures

sortedShardList

protected volatile ShardDoc[] sortedShardList
Constructor Detail

TransportSearchTypeAction.BaseAsyncAction

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

start

public void start()

buildShardFailures

protected 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.


invokeListener

protected void invokeListener(SearchResponse response)

invokeListener

protected void invokeListener(java.lang.Throwable t)

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()

firstPhaseName

protected abstract java.lang.String firstPhaseName()