public class CountCoBundleTrigger<IN1,IN2> extends Object implements CoBundleTrigger<IN1,IN2>
CoBundleTrigger
that fires once the count of elements in a bundle reaches the given
count.Constructor and Description |
---|
CountCoBundleTrigger(long maxCount) |
Modifier and Type | Method and Description |
---|---|
String |
explain() |
void |
onElement1(IN1 element)
Called for every element that gets added to the bundle from the first input.
|
void |
onElement2(IN2 element)
Called for every element that gets added to the bundle from the second input.
|
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)
CoBundleTrigger
registerCallback
in interface CoBundleTrigger<IN1,IN2>
public void onElement1(IN1 element) throws Exception
CoBundleTrigger
BundleTriggerCallback.finishBundle()
should be invoked.onElement1
in interface CoBundleTrigger<IN1,IN2>
element
- The element that arrived from the first input.Exception
public void onElement2(IN2 element) throws Exception
CoBundleTrigger
BundleTriggerCallback.finishBundle()
should be invoked.onElement2
in interface CoBundleTrigger<IN1,IN2>
element
- The element that arrived from the second input.Exception
public void reset()
CoBundleTrigger
reset
in interface CoBundleTrigger<IN1,IN2>
public String explain()
explain
in interface CoBundleTrigger<IN1,IN2>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.