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 Object


Field Summary
protected  ClusterState clusterState
           
protected  int expectedSuccessfulOps
           
protected  ActionListener<SearchResponse> listener
           
protected  DiscoveryNodes nodes
           
protected  SearchRequest request
           
protected  ShardDoc[] sortedShardList
           
protected  long startTime
           
protected  AtomicInteger successulOps
           
 
Constructor Summary
protected TransportSearchTypeAction.BaseAsyncAction(SearchRequest request, ActionListener<SearchResponse> listener)
           
 
Method Summary
protected  void addShardFailure(ShardSearchFailure failure)
           
protected  ShardSearchFailure[] buildShardFailures()
           
protected  long buildTookInMillis()
          Builds how long it took to execute the search.
protected abstract  String firstPhaseName()
           
protected abstract  void moveToSecondPhase()
           
protected abstract  void processFirstPhaseResult(ShardRouting shard, FirstResult result)
           
protected  void releaseIrrelevantSearchContexts(Map<SearchShardTarget,QuerySearchResultProvider> queryResults, 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 AtomicInteger successulOps

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

addShardFailure

protected final void addShardFailure(ShardSearchFailure failure)

releaseIrrelevantSearchContexts

protected void releaseIrrelevantSearchContexts(Map<SearchShardTarget,QuerySearchResultProvider> queryResults,
                                               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 Exception
Throws:
Exception

firstPhaseName

protected abstract String firstPhaseName()


Copyright © 2009-2012. All Rights Reserved.