Class StreamletOperator<R,T>
- java.lang.Object
-
- org.apache.heron.api.topology.BaseComponent
-
- org.apache.heron.api.bolt.BaseRichBolt
-
- org.apache.heron.streamlet.impl.operators.StreamletOperator<R,T>
-
- All Implemented Interfaces:
Serializable
,IBolt
,IRichBolt
,IComponent
,IStreamletOperator<R,T>
,IStreamletRichOperator<R,T>
- Direct Known Subclasses:
ComplexSink
,ConsumerSink
,FilterOperator
,FlatMapOperator
,GeneralReduceByKeyOperator
,KeyByOperator
,LogSink
,MapOperator
,ReduceByKeyOperator
,SplitOperator
,TransformOperator
,UnionOperator
public abstract class StreamletOperator<R,T> extends BaseRichBolt implements IStreamletRichOperator<R,T>
The Bolt interface that other operators of the streamlet packages extend. The only common stuff amongst all of them is the output streams- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OutputCollector
collector
protected static String
OUTPUT_FIELD_NAME
-
Constructor Summary
Constructors Constructor Description StreamletOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer)
The operators implementing streamlet functionality have some properties.void
prepare(Map<String,Object> map, TopologyContext topologyContext, OutputCollector outputCollector)
Called when a task for this component is initialized within a worker on the cluster.-
Methods inherited from class org.apache.heron.api.bolt.BaseRichBolt
cleanup
-
Methods inherited from class org.apache.heron.api.topology.BaseComponent
getComponentConfiguration
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.heron.api.topology.IComponent
getComponentConfiguration
-
-
-
-
Field Detail
-
OUTPUT_FIELD_NAME
protected static final String OUTPUT_FIELD_NAME
- See Also:
- Constant Field Values
-
collector
protected OutputCollector collector
-
-
Method Detail
-
prepare
public void prepare(Map<String,Object> map, TopologyContext topologyContext, OutputCollector outputCollector)
Description copied from interface:IBolt
Called when a task for this component is initialized within a worker on the cluster. It provides the bolt with the environment in which the bolt executes.This includes the:
- Specified by:
prepare
in interfaceIBolt
- Parameters:
map
- The Heron configuration for this bolt. This is the configuration provided to the topology merged in with cluster configuration on this machine.topologyContext
- This object can be used to get information about this task's place within the topology, including the task id and component id of this task, input and output information, etc.outputCollector
- The collector is used to emit tuples from this bolt. Tuples can be emitted at any time, including the prepare and cleanup methods. The collector is thread-safe and should be saved as an instance variable of this bolt object.
-
declareOutputFields
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer)
The operators implementing streamlet functionality have some properties. 1. They all output only one stream 2. They should be able to consume each other's output This imply that the output stream should be named same for all of them.- Specified by:
declareOutputFields
in interfaceIComponent
- Parameters:
outputFieldsDeclarer
- this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
-
-