T
- Tuple typepublic class StreamScope<T> extends java.lang.Object implements Consumer<T>
A StreamScope
is expected to be used as parameter to
StreamScope
oplet.
A StreamScope.TriggerManager
controls which tuples are captured.
A StreamScope.BufferManager
controls the retention policy for captured tuples.
A StreamScope.Sample
is created for each captured tuple containing the tuple
(not copied) and capture timestamps. Samples are retrieved using getSamples()
.
Sample capture can be enabled/disabled (setEnabled(boolean)
.
It is disabled by default. Capture can also be paused and resumed via
the TriggerManager
.
StreamScope instances are typically registered in and located via
a StreamScopeRegistry
runtime service
and StreamScopeRegistryMXBean
runtime ControlService.
StreamScopeRegistry
,
DevelopmentProvider
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
StreamScope.BufferManager<T>
Control the retention of captured tuples.
|
static class |
StreamScope.Sample<T>
A captured tuple.
|
static class |
StreamScope.TriggerManager<T>
Control what triggers capturing of tuples.
|
Constructor and Description |
---|
StreamScope()
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T tuple)
Apply the function to
value . |
StreamScope.BufferManager<T> |
bufferMgr()
Get the
StreamScope.BufferManager |
int |
getSampleCount()
Get the number of Samples currently captured
|
java.util.List<StreamScope.Sample<T>> |
getSamples()
Get all captured tuples.
|
boolean |
isEnabled()
Is tuple capture enabled?
|
void |
setEnabled(boolean isEnabled)
Enable or disable tuple capture.
|
java.lang.String |
toString() |
StreamScope.TriggerManager<T> |
triggerMgr()
Get the
StreamScope.TriggerManager |
public StreamScope()
Sample capture is disabled.
public boolean isEnabled()
public void setEnabled(boolean isEnabled)
Disabling releases the capture buffer.
isEnabled
- true to enable, false to disable.public StreamScope.BufferManager<T> bufferMgr()
StreamScope.BufferManager
public StreamScope.TriggerManager<T> triggerMgr()
StreamScope.TriggerManager
public java.util.List<StreamScope.Sample<T>> getSamples()
The returned samples are removed from the capture buffer.
public int getSampleCount()
public void accept(T tuple)
Consumer
value
.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641