public static final class SearchOperationListener.CompositeListener extends java.lang.Object implements SearchOperationListener
SearchOperationListener.CompositeListener
Constructor and Description |
---|
CompositeListener(java.util.List<SearchOperationListener> listeners,
org.apache.logging.log4j.Logger logger) |
Modifier and Type | Method and 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 search
SearchContext is freed. |
void |
onNewContext(SearchContext context)
Executed when a new search context was created
|
void |
onNewScrollContext(SearchContext context)
Executed when a new scroll search
SearchContext was created |
void |
onPreFetchPhase(SearchContext searchContext)
Executed before the fetch phase is executed
|
void |
onPreQueryPhase(SearchContext searchContext)
Executed before the query phase is executed
|
void |
onQueryPhase(SearchContext searchContext,
long tookInNanos)
Executed after the query phase successfully finished.
|
void |
validateSearchContext(SearchContext context,
TransportRequest request)
Executed prior to using a
SearchContext that has been retrieved
from the active contexts. |
public CompositeListener(java.util.List<SearchOperationListener> listeners, org.apache.logging.log4j.Logger logger)
public void onPreQueryPhase(SearchContext searchContext)
SearchOperationListener
onPreQueryPhase
in interface SearchOperationListener
searchContext
- the current search contextpublic void onFailedQueryPhase(SearchContext searchContext)
SearchOperationListener
onFailedQueryPhase
in interface SearchOperationListener
searchContext
- the current search contextpublic void onQueryPhase(SearchContext searchContext, long tookInNanos)
SearchOperationListener
onQueryPhase
in interface SearchOperationListener
searchContext
- the current search contexttookInNanos
- the number of nanoseconds the query execution tookSearchOperationListener.onFailedQueryPhase(SearchContext)
public void onPreFetchPhase(SearchContext searchContext)
SearchOperationListener
onPreFetchPhase
in interface SearchOperationListener
searchContext
- the current search contextpublic void onFailedFetchPhase(SearchContext searchContext)
SearchOperationListener
onFailedFetchPhase
in interface SearchOperationListener
searchContext
- the current search contextpublic void onFetchPhase(SearchContext searchContext, long tookInNanos)
SearchOperationListener
onFetchPhase
in interface SearchOperationListener
searchContext
- the current search contexttookInNanos
- the number of nanoseconds the fetch execution tookSearchOperationListener.onFailedFetchPhase(SearchContext)
public void onNewContext(SearchContext context)
SearchOperationListener
onNewContext
in interface SearchOperationListener
context
- the created contextpublic void onFreeContext(SearchContext context)
SearchOperationListener
onFreeContext
in interface SearchOperationListener
context
- the freed search contextpublic void onNewScrollContext(SearchContext context)
SearchOperationListener
SearchContext
was createdonNewScrollContext
in interface SearchOperationListener
context
- the created search contextpublic void onFreeScrollContext(SearchContext context)
SearchOperationListener
SearchContext
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.onFreeScrollContext
in interface SearchOperationListener
context
- the freed search contextpublic void validateSearchContext(SearchContext context, TransportRequest request)
SearchOperationListener
SearchContext
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.validateSearchContext
in interface SearchOperationListener
context
- the context retrieved from the active contextsrequest
- the request that is going to use the search context