Package org.apache.heron.streamlet.impl
Class ContextImpl
- java.lang.Object
-
- org.apache.heron.streamlet.impl.ContextImpl
-
-
Constructor Summary
Constructors Constructor Description ContextImpl(TopologyContext topologyContext, Map<String,Object> topologyConfig, State<Serializable,Serializable> state)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
ContextImpl
public ContextImpl(TopologyContext topologyContext, Map<String,Object> topologyConfig, State<Serializable,Serializable> state)
-
-
Method Detail
-
getTaskId
public int getTaskId()
Description copied from interface:Context
Fetches the task id of the current instance of the operator
-
getConfig
public Map<String,Object> getConfig()
Description copied from interface:Context
Fetches the config of the computation
-
getStreamName
public String getStreamName()
Description copied from interface:Context
The stream name that we are operating on- Specified by:
getStreamName
in interfaceContext
- Returns:
- the stream name that we are operating on
-
getStreamPartition
public int getStreamPartition()
Description copied from interface:Context
The partition number that we are operating on- Specified by:
getStreamPartition
in interfaceContext
- Returns:
- the partition number
-
registerMetric
public <T> void registerMetric(String metricName, int collectionInterval, Supplier<T> metricFn)
Description copied from interface:Context
Register a metric function. This function will be called by the system every collectionInterval seconds and the resulting value will be collected- Specified by:
registerMetric
in interfaceContext
-
getState
public State<Serializable,Serializable> getState()
Description copied from interface:Context
The state where components can store any of their local state
-
-