Package org.apache.storm.starter.bolt
Class SlidingWindowSumBolt
- java.lang.Object
-
- org.apache.storm.topology.base.BaseWindowedBolt
-
- org.apache.storm.starter.bolt.SlidingWindowSumBolt
-
- All Implemented Interfaces:
Serializable
,IComponent
,IWindowedBolt
public class SlidingWindowSumBolt extends BaseWindowedBolt
Computes sliding window sum.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.storm.topology.base.BaseWindowedBolt
BaseWindowedBolt.Count, BaseWindowedBolt.Duration
-
-
Field Summary
-
Fields inherited from class org.apache.storm.topology.base.BaseWindowedBolt
timestampExtractor, windowConfiguration
-
-
Constructor Summary
Constructors Constructor Description SlidingWindowSumBolt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
declareOutputFields(OutputFieldsDeclarer declarer)
Declare the output schema for all the streams of this topology.void
execute(TupleWindow inputWindow)
Process the tuple window and optionally emit new tuples based on the tuples in the input window.void
prepare(Map<String,Object> topoConf, TopologyContext context, OutputCollector collector)
This is similar to theIBolt.prepare(Map, TopologyContext, OutputCollector)
except that while emitting, the tuples are automatically anchored to the tuples in the inputWindow.-
Methods inherited from class org.apache.storm.topology.base.BaseWindowedBolt
cleanup, getComponentConfiguration, getTimestampExtractor, withLag, withLateTupleStream, withTimestampExtractor, withTimestampField, withTumblingWindow, withTumblingWindow, withWatermarkInterval, withWindow, withWindow, withWindow, withWindow, withWindow, withWindow
-
-
-
-
Method Detail
-
prepare
public void prepare(Map<String,Object> topoConf, TopologyContext context, OutputCollector collector)
Description copied from interface:IWindowedBolt
This is similar to theIBolt.prepare(Map, TopologyContext, OutputCollector)
except that while emitting, the tuples are automatically anchored to the tuples in the inputWindow.- Specified by:
prepare
in interfaceIWindowedBolt
- Overrides:
prepare
in classBaseWindowedBolt
-
execute
public void execute(TupleWindow inputWindow)
Description copied from interface:IWindowedBolt
Process the tuple window and optionally emit new tuples based on the tuples in the input window.
-
declareOutputFields
public void declareOutputFields(OutputFieldsDeclarer declarer)
Description copied from interface:IComponent
Declare the output schema for all the streams of this topology.- Specified by:
declareOutputFields
in interfaceIComponent
- Overrides:
declareOutputFields
in classBaseWindowedBolt
- Parameters:
declarer
- this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
-
-