Module org.elasticsearch.server
Package org.elasticsearch.action.support
Class GroupedActionListener<T>
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<T,Collection<T>>
org.elasticsearch.action.support.GroupedActionListener<T>
- All Implemented Interfaces:
ActionListener<T>
An action listener that delegates its results to another listener once
it has received N results (either successes or failures). This allows synchronous
tasks to be forked off in a loop with the same listener and respond to a
higher level listener once all tasks responded.
-
Field Summary
Fields inherited from class org.elasticsearch.action.DelegatingActionListener
delegate -
Constructor Summary
ConstructorsConstructorDescriptionGroupedActionListener(int groupSize, ActionListener<Collection<T>> delegate) Creates a new listener -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete this listener with an exceptional response.voidonResponse(T element) Complete this listener with a successful (or at least, non-exceptional) response.Methods inherited from class org.elasticsearch.action.DelegatingActionListener
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
GroupedActionListener
Creates a new listener- Parameters:
groupSize- the group sizedelegate- the delegate listener
-
-
Method Details
-
onResponse
Description copied from interface:ActionListenerComplete this listener with a successful (or at least, non-exceptional) response. -
onFailure
Description copied from interface:ActionListenerComplete this listener with an exceptional response.- Specified by:
onFailurein interfaceActionListener<T>- Overrides:
onFailurein classDelegatingActionListener<T,Collection<T>>
-