Package org.elasticsearch.index.shard
Interface SearchOperationListener
-
- All Known Implementing Classes:
SearchOperationListener.CompositeListener,SearchSlowLog,ShardSearchStats
public interface SearchOperationListenerAn listener for search, fetch and context events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSearchOperationListener.CompositeListenerA Composite listener that multiplexes calls to each of the listeners methods.
-
Method Summary
Modifier and Type Method Description default voidonFailedFetchPhase(SearchContext searchContext)Executed if a fetch phased failed.default voidonFailedQueryPhase(SearchContext searchContext)Executed if a query phased failed.default voidonFetchPhase(SearchContext searchContext, long tookInNanos)Executed after the fetch phase successfully finished.default voidonFreeContext(SearchContext context)Executed when a previously created search context is freed.default voidonFreeScrollContext(SearchContext context)Executed when a scroll searchSearchContextis freed.default voidonNewContext(SearchContext context)Executed when a new search context was createddefault voidonNewScrollContext(SearchContext context)Executed when a new scroll searchSearchContextwas createddefault voidonPreFetchPhase(SearchContext searchContext)Executed before the fetch phase is executeddefault voidonPreQueryPhase(SearchContext searchContext)Executed before the query phase is executeddefault voidonQueryPhase(SearchContext searchContext, long tookInNanos)Executed after the query phase successfully finished.default voidvalidateSearchContext(SearchContext context, TransportRequest transportRequest)Executed prior to using aSearchContextthat has been retrieved from the active contexts.
-
-
-
Method Detail
-
onPreQueryPhase
default void onPreQueryPhase(SearchContext searchContext)
Executed before the query phase is executed- Parameters:
searchContext- the current search context
-
onFailedQueryPhase
default void onFailedQueryPhase(SearchContext searchContext)
Executed if a query phased failed.- Parameters:
searchContext- the current search context
-
onQueryPhase
default void onQueryPhase(SearchContext searchContext, long tookInNanos)
Executed after the query phase successfully finished. Note: this is not invoked if the query phase execution failed.- Parameters:
searchContext- the current search contexttookInNanos- the number of nanoseconds the query execution took- See Also:
onFailedQueryPhase(SearchContext)
-
onPreFetchPhase
default void onPreFetchPhase(SearchContext searchContext)
Executed before the fetch phase is executed- Parameters:
searchContext- the current search context
-
onFailedFetchPhase
default void onFailedFetchPhase(SearchContext searchContext)
Executed if a fetch phased failed.- Parameters:
searchContext- the current search context
-
onFetchPhase
default void onFetchPhase(SearchContext searchContext, long tookInNanos)
Executed after the fetch phase successfully finished. Note: this is not invoked if the fetch phase execution failed.- Parameters:
searchContext- the current search contexttookInNanos- the number of nanoseconds the fetch execution took- See Also:
onFailedFetchPhase(SearchContext)
-
onNewContext
default void onNewContext(SearchContext context)
Executed when a new search context was created- Parameters:
context- the created context
-
onFreeContext
default void onFreeContext(SearchContext context)
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.- Parameters:
context- the freed search context
-
onNewScrollContext
default void onNewScrollContext(SearchContext context)
Executed when a new scroll searchSearchContextwas created- Parameters:
context- the created search context
-
onFreeScrollContext
default void onFreeScrollContext(SearchContext context)
Executed when a scroll searchSearchContextis 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.- Parameters:
context- the freed search context
-
validateSearchContext
default void validateSearchContext(SearchContext context, TransportRequest transportRequest)
Executed prior to using aSearchContextthat 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.- Parameters:
context- the context retrieved from the active contextstransportRequest- the request that is going to use the search context
-
-