public class StreamScopeBean extends java.lang.Object implements StreamScopeMXBean
StreamScopeMXBean
.StreamScopeRegistryBean
TYPE
Constructor and Description |
---|
StreamScopeBean(StreamScope<?> streamScope) |
Modifier and Type | Method and Description |
---|---|
int |
getSampleCount()
Get the number of Samples currently captured
|
java.lang.String |
getSamples()
Get all captured tuples as JSON.
|
boolean |
isEnabled()
Is tuple capture enabled?
|
boolean |
isPaused()
Is capture paused?
|
void |
setCaptureByCount(int count)
Capture the first and every nth tuple
|
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 |
setEnabled(boolean isEnabled)
Enable or disable tuple capture.
|
void |
setMaxRetentionCount(int maxCount)
Set the maximum number of tuples to retain.
|
void |
setMaxRetentionTime(long age,
java.util.concurrent.TimeUnit unit)
Set the maximum retention time of a tuple.
|
void |
setPaused(boolean paused)
Set capture paused control
|
public StreamScopeBean(StreamScope<?> streamScope)
public boolean isEnabled()
StreamScopeMXBean
isEnabled
in interface StreamScopeMXBean
public void setEnabled(boolean isEnabled)
StreamScopeMXBean
Disabling releases the capture buffer.
setEnabled
in interface StreamScopeMXBean
isEnabled
- true to enable, false to disable.StreamScopeMXBean.setPaused(boolean)
public boolean isPaused()
StreamScopeMXBean
isPaused
in interface StreamScopeMXBean
public void setPaused(boolean paused)
StreamScopeMXBean
Pausing doesn't affect the capture buffer's current contents.
setPaused
in interface StreamScopeMXBean
paused
- true to pause, false to clear pause.public java.lang.String getSamples()
StreamScopeMXBean
The JSON is that generated by Gson.toJson(StreamScope.getSamples())
.
The JSON is an array of Sample
JSON objects.
Each Sample JSON object consists of:
The returned samples are removed from the capture buffer.
getSamples
in interface StreamScopeMXBean
public int getSampleCount()
StreamScopeMXBean
getSampleCount
in interface StreamScopeMXBean
public void setMaxRetentionCount(int maxCount)
StreamScopeMXBean
The capture buffer is cleared.
setMaxRetentionCount
in interface StreamScopeMXBean
maxCount
- the maximum number of tuples to retain.
Specify 0 to disable count based retention.public void setMaxRetentionTime(long age, java.util.concurrent.TimeUnit unit)
StreamScopeMXBean
The capture buffer is cleared.
setMaxRetentionTime
in interface StreamScopeMXBean
age
- the amount of time to retain a tuple.
Specify 0 to disable age based retention.unit
- TimeUnit
public void setCaptureByCount(int count)
StreamScopeMXBean
setCaptureByCount
in interface StreamScopeMXBean
count
- the nth value intervalpublic void setCaptureByTime(long elapsed, java.util.concurrent.TimeUnit unit)
StreamScopeMXBean
period
unit
time has elapsed since the previous captured tuple.setCaptureByTime
in interface StreamScopeMXBean
elapsed
- time to delay until next captureunit
- TimeUnit
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641