public class CountBundleTrigger<T> extends Object implements BundleTrigger<T>
BundleTrigger
that fires once the count of elements in a bundle reaches the given
count.Constructor and Description |
---|
CountBundleTrigger(long maxCount) |
Modifier and Type | Method and Description |
---|---|
String |
explain() |
void |
onElement(T element)
Called for every element that gets added to the bundle.
|
void |
registerCallback(BundleTriggerCallback callback)
Register a callback which will be called once this trigger decides to finish this bundle.
|
void |
reset()
Reset the trigger to its initiate status.
|
public void registerCallback(BundleTriggerCallback callback)
BundleTrigger
registerCallback
in interface BundleTrigger<T>
public void onElement(T element) throws Exception
BundleTrigger
BundleTriggerCallback.finishBundle()
should be invoked.onElement
in interface BundleTrigger<T>
element
- The element that arrived.Exception
public void reset()
BundleTrigger
reset
in interface BundleTrigger<T>
public String explain()
explain
in interface BundleTrigger<T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.