Package org.elasticsearch.index.shard
Class SearchOperationListener.CompositeListener
- java.lang.Object
-
- org.elasticsearch.index.shard.SearchOperationListener.CompositeListener
-
- All Implemented Interfaces:
SearchOperationListener
- Enclosing interface:
- SearchOperationListener
public static final class SearchOperationListener.CompositeListener extends java.lang.Object implements SearchOperationListener
A Composite listener that multiplexes calls to each of the listeners methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.index.shard.SearchOperationListener
SearchOperationListener.CompositeListener
-
-
Constructor Summary
Constructors Constructor Description CompositeListener(java.util.List<SearchOperationListener> listeners, org.apache.logging.log4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onFailedFetchPhase(SearchContext searchContext)
Executed if a fetch phased failed.void
onFailedQueryPhase(SearchContext searchContext)
Executed if a query phased failed.void
onFetchPhase(SearchContext searchContext, long tookInNanos)
Executed after the fetch phase successfully finished.void
onFreeContext(SearchContext context)
Executed when a previously created search context is freed.void
onFreeScrollContext(SearchContext context)
Executed when a scroll searchSearchContext
is freed.void
onNewContext(SearchContext context)
Executed when a new search context was createdvoid
onNewScrollContext(SearchContext context)
Executed when a new scroll searchSearchContext
was createdvoid
onPreFetchPhase(SearchContext searchContext)
Executed before the fetch phase is executedvoid
onPreQueryPhase(SearchContext searchContext)
Executed before the query phase is executedvoid
onQueryPhase(SearchContext searchContext, long tookInNanos)
Executed after the query phase successfully finished.void
validateSearchContext(SearchContext context, TransportRequest request)
Executed prior to using aSearchContext
that has been retrieved from the active contexts.
-
-
-
Constructor Detail
-
CompositeListener
public CompositeListener(java.util.List<SearchOperationListener> listeners, org.apache.logging.log4j.Logger logger)
-
-
Method Detail
-
onPreQueryPhase
public void onPreQueryPhase(SearchContext searchContext)
Description copied from interface:SearchOperationListener
Executed before the query phase is executed- Specified by:
onPreQueryPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search context
-
onFailedQueryPhase
public void onFailedQueryPhase(SearchContext searchContext)
Description copied from interface:SearchOperationListener
Executed if a query phased failed.- Specified by:
onFailedQueryPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search context
-
onQueryPhase
public void onQueryPhase(SearchContext searchContext, long tookInNanos)
Description copied from interface:SearchOperationListener
Executed after the query phase successfully finished. Note: this is not invoked if the query phase execution failed.- Specified by:
onQueryPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search contexttookInNanos
- the number of nanoseconds the query execution took- See Also:
SearchOperationListener.onFailedQueryPhase(SearchContext)
-
onPreFetchPhase
public void onPreFetchPhase(SearchContext searchContext)
Description copied from interface:SearchOperationListener
Executed before the fetch phase is executed- Specified by:
onPreFetchPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search context
-
onFailedFetchPhase
public void onFailedFetchPhase(SearchContext searchContext)
Description copied from interface:SearchOperationListener
Executed if a fetch phased failed.- Specified by:
onFailedFetchPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search context
-
onFetchPhase
public void onFetchPhase(SearchContext searchContext, long tookInNanos)
Description copied from interface:SearchOperationListener
Executed after the fetch phase successfully finished. Note: this is not invoked if the fetch phase execution failed.- Specified by:
onFetchPhase
in interfaceSearchOperationListener
- Parameters:
searchContext
- the current search contexttookInNanos
- the number of nanoseconds the fetch execution took- See Also:
SearchOperationListener.onFailedFetchPhase(SearchContext)
-
onNewContext
public void onNewContext(SearchContext context)
Description copied from interface:SearchOperationListener
Executed when a new search context was created- Specified by:
onNewContext
in interfaceSearchOperationListener
- Parameters:
context
- the created context
-
onFreeContext
public void onFreeContext(SearchContext context)
Description copied from interface:SearchOperationListener
Executed when a previously created search context is freed. This happens either when the search execution finishes, if the execution failed or if the search context as idle for and needs to be cleaned up.- Specified by:
onFreeContext
in interfaceSearchOperationListener
- Parameters:
context
- the freed search context
-
onNewScrollContext
public void onNewScrollContext(SearchContext context)
Description copied from interface:SearchOperationListener
Executed when a new scroll searchSearchContext
was created- Specified by:
onNewScrollContext
in interfaceSearchOperationListener
- Parameters:
context
- the created search context
-
onFreeScrollContext
public void onFreeScrollContext(SearchContext context)
Description copied from interface:SearchOperationListener
Executed when a scroll searchSearchContext
is freed. This happens either when the scroll search execution finishes, if the execution failed or if the search context as idle for and needs to be cleaned up.- Specified by:
onFreeScrollContext
in interfaceSearchOperationListener
- Parameters:
context
- the freed search context
-
validateSearchContext
public void validateSearchContext(SearchContext context, TransportRequest request)
Description copied from interface:SearchOperationListener
Executed prior to using aSearchContext
that has been retrieved from the active contexts. If the context is deemed invalid a runtime exception can be thrown, which will prevent the context from being used.- Specified by:
validateSearchContext
in interfaceSearchOperationListener
- Parameters:
context
- the context retrieved from the active contextsrequest
- the request that is going to use the search context
-
-