T
- Tuple typepublic static class StreamScope.TriggerManager<T>
extends java.lang.Object
The following modes are supported:
Tuple capture can be temporarily paused via setPaused
.
Pausing capture does not clear the capture buffer.
Capture processing can be automatically paused when a particular event
has occurred via setPauseOn
.
The pause predicate is evaluated after processing each received tuple.
Use setPaused(boolean)
setPaused} to re-enable capture
following a triggered pause.
The default configuration is continuous (by-count==1) and not paused.
Constructor and Description |
---|
TriggerManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
isPaused()
Is capture paused?
|
void |
setCaptureByCount(int count)
Capture the first and every nth tuple
|
void |
setCaptureByPredicate(Predicate<T> predicate)
Capture a tuple if the
predicate test of the tuple returns true. |
void |
setCaptureByTime(long elapsed,
java.util.concurrent.TimeUnit unit)
Capture the 1st tuple and then the next tuple after
period
unit time has elapsed since the previous captured tuple. |
void |
setPaused(boolean paused)
Set capture paused control
|
void |
setPauseOn(Predicate<T> predicate)
Set a pause-on predicate.
|
java.lang.String |
toString() |
public void setPaused(boolean paused)
paused
- true to pause, false to clear pause.public boolean isPaused()
public void setPauseOn(Predicate<T> predicate)
predicate
- the predicateFunctions.alwaysFalse()
public void setCaptureByCount(int count)
count
- the nth value intervalpublic void setCaptureByTime(long elapsed, java.util.concurrent.TimeUnit unit)
period
unit
time has elapsed since the previous captured tuple.elapsed
- time to delay until next captureunit
- TimeUnit
public void setCaptureByPredicate(Predicate<T> predicate)
predicate
test of the tuple returns true.predicate
- the predicatepublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641