Module org.elasticsearch.server
Package org.elasticsearch.action.support
Class CountDownActionListener
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<Void,Void>
org.elasticsearch.action.support.CountDownActionListener
- All Implemented Interfaces:
ActionListener<Void>
Wraps another listener and adds a counter -- each invocation of this listener will decrement the counter, and when the counter has been
exhausted the final invocation of this listener will delegate to the wrapped listener. Similar to
GroupedActionListener
, but for
the cases where tracking individual results is not useful.-
Field Summary
Fields inherited from class org.elasticsearch.action.DelegatingActionListener
delegate
-
Constructor Summary
ConstructorsConstructorDescriptionCountDownActionListener
(int groupSize, ActionListener<Void> delegate) Creates a new listener -
Method Summary
Modifier and TypeMethodDescriptionvoid
A failure caused by an exception at some phase of the task.void
onResponse
(Void element) Handle action response.Methods inherited from class org.elasticsearch.action.DelegatingActionListener
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
CountDownActionListener
Creates a new listener- Parameters:
groupSize
- the group sizedelegate
- the delegate listener
-
-
Method Details
-
onResponse
Description copied from interface:ActionListener
Handle action response. This response may constitute a failure or a success but it is up to the listener to make that decision. -
onFailure
Description copied from interface:ActionListener
A failure caused by an exception at some phase of the task.- Specified by:
onFailure
in interfaceActionListener<Void>
- Overrides:
onFailure
in classDelegatingActionListener<Void,
Void>
-