public class WordCounter extends BaseBasicBolt
This bolt is used by the HBase example. It simply emits the first field found in the incoming tuple as “word”, with a “count” of 1.
In this case, the downstream HBase bolt handles the counting, so a value of 1 will just increment the HBase counter by one.
| Constructor and Description |
|---|
WordCounter() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
void |
declareOutputFields(OutputFieldsDeclarer declarer) |
void |
execute(Tuple input,
BasicOutputCollector collector) |
Map<String,Object> |
getComponentConfiguration() |
void |
prepare(Map stormConf,
TopologyContext context) |
public void prepare(Map stormConf, TopologyContext context)
prepare in interface IBasicBoltprepare in class BaseBasicBoltpublic void execute(Tuple input, BasicOutputCollector collector)
public void cleanup()
cleanup in interface IBasicBoltcleanup in class BaseBasicBoltpublic void declareOutputFields(OutputFieldsDeclarer declarer)
public Map<String,Object> getComponentConfiguration()
getComponentConfiguration in interface IComponentgetComponentConfiguration in class BaseComponentCopyright © 2018 The Apache Software Foundation. All Rights Reserved.