Package org.apache.storm.starter.bolt
Class AbstractRankerBolt
- java.lang.Object
-
- org.apache.storm.topology.base.BaseComponent
-
- org.apache.storm.topology.base.BaseBasicBolt
-
- org.apache.storm.starter.bolt.AbstractRankerBolt
-
- All Implemented Interfaces:
Serializable
,IBasicBolt
,IComponent
- Direct Known Subclasses:
IntermediateRankingsBolt
,TotalRankingsBolt
public abstract class AbstractRankerBolt extends BaseBasicBolt
This abstract bolt provides the basic behavior of bolts that rank objects according to their count. It uses a template method design pattern forexecute(Tuple, BasicOutputCollector)
to allow actual bolt implementations to specify how incoming tuples are processed, i.e. how the objects embedded within those tuples are retrieved and counted.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractRankerBolt()
AbstractRankerBolt(int topN)
AbstractRankerBolt(int topN, int emitFrequencyInSeconds)
-
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(Tuple tuple, BasicOutputCollector collector)
This method functions as a template method (design pattern).Map<String,Object>
getComponentConfiguration()
Declare configuration specific to this component.protected Rankings
getRankings()
-
Methods inherited from class org.apache.storm.topology.base.BaseBasicBolt
cleanup, prepare
-
-
-
-
Method Detail
-
getRankings
protected Rankings getRankings()
-
execute
public final void execute(Tuple tuple, BasicOutputCollector collector)
This method functions as a template method (design pattern).
-
declareOutputFields
public void declareOutputFields(OutputFieldsDeclarer declarer)
Description copied from interface:IComponent
Declare the output schema for all the streams of this topology.- Parameters:
declarer
- this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
-
getComponentConfiguration
public Map<String,Object> getComponentConfiguration()
Description copied from interface:IComponent
Declare configuration specific to this component. Only a subset of the "topology.*" configs can be overridden. The component configuration can be further overridden when constructing the topology usingTopologyBuilder
- Specified by:
getComponentConfiguration
in interfaceIComponent
- Overrides:
getComponentConfiguration
in classBaseComponent
-
-