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.| Constructor and Description |
|---|
AbstractRankerBolt() |
AbstractRankerBolt(int topN) |
AbstractRankerBolt(int topN,
int emitFrequencyInSeconds) |
| Modifier and Type | Method and 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() |
cleanup, preparepublic AbstractRankerBolt()
public AbstractRankerBolt(int topN)
public AbstractRankerBolt(int topN,
int emitFrequencyInSeconds)
protected Rankings getRankings()
public final void execute(Tuple tuple, BasicOutputCollector collector)
This method functions as a template method (design pattern).
public void declareOutputFields(OutputFieldsDeclarer declarer)
IComponentDeclare the output schema for all the streams of this topology.
declarer - this is used to declare output stream ids, output fields, and whether or not each output stream is a direct streampublic Map<String,Object> getComponentConfiguration()
IComponentDeclare 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 using TopologyBuilder
getComponentConfiguration in interface IComponentgetComponentConfiguration in class BaseComponentCopyright © 2021 The Apache Software Foundation. All rights reserved.