Package org.apache.heron.streamlet
Interface Context
-
- All Known Implementing Classes:
ContextImpl
public interface Context
Context is the information available at runtime for operators like transform. It contains basic things like config, runtime information like task, the stream that it is operating on, ProcessState, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>
getConfig()
Fetches the config of the computationState<Serializable,Serializable>
getState()
The state where components can store any of their local stateString
getStreamName()
The stream name that we are operating onint
getStreamPartition()
The partition number that we are operating onint
getTaskId()
Fetches the task id of the current instance of the operator<T> void
registerMetric(String metricName, int collectionInterval, Supplier<T> metricFn)
Register a metric function.
-
-
-
Method Detail
-
getTaskId
int getTaskId()
Fetches the task id of the current instance of the operator- Returns:
- the task id.
-
getStreamName
String getStreamName()
The stream name that we are operating on- Returns:
- the stream name that we are operating on
-
getStreamPartition
int getStreamPartition()
The partition number that we are operating on- Returns:
- the partition number
-
registerMetric
<T> void registerMetric(String metricName, int collectionInterval, Supplier<T> metricFn)
Register a metric function. This function will be called by the system every collectionInterval seconds and the resulting value will be collected
-
getState
State<Serializable,Serializable> getState()
The state where components can store any of their local state- Returns:
- The state interface where users can store their local state
-
-