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 stateStringgetStreamName()The stream name that we are operating onintgetStreamPartition()The partition number that we are operating onintgetTaskId()Fetches the task id of the current instance of the operator<T> voidregisterMetric(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:ContextFetches the task id of the current instance of the operator
-
getConfig
public Map<String,Object> getConfig()
Description copied from interface:ContextFetches the config of the computation
-
getStreamName
public String getStreamName()
Description copied from interface:ContextThe stream name that we are operating on- Specified by:
getStreamNamein interfaceContext- Returns:
- the stream name that we are operating on
-
getStreamPartition
public int getStreamPartition()
Description copied from interface:ContextThe partition number that we are operating on- Specified by:
getStreamPartitionin interfaceContext- Returns:
- the partition number
-
registerMetric
public <T> void registerMetric(String metricName, int collectionInterval, Supplier<T> metricFn)
Description copied from interface:ContextRegister a metric function. This function will be called by the system every collectionInterval seconds and the resulting value will be collected- Specified by:
registerMetricin interfaceContext
-
getState
public State<Serializable,Serializable> getState()
Description copied from interface:ContextThe state where components can store any of their local state
-
-