public class BoltCounter extends Object implements org.apache.storm.topology.IRichBolt
<String,Integer>
) and sums the given word count for each unique word (output tuple schema:
<String,Integer>
).
Same as BoltCounterByName
, but accesses input attribute by index (instead of name).
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_COUNT |
static String |
ATTRIBUTE_WORD |
Constructor and Description |
---|
BoltCounter() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
void |
declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer) |
void |
execute(org.apache.storm.tuple.Tuple input) |
Map<String,Object> |
getComponentConfiguration() |
void |
prepare(Map stormConf,
org.apache.storm.task.TopologyContext context,
org.apache.storm.task.OutputCollector collector) |
public static final String ATTRIBUTE_WORD
public static final String ATTRIBUTE_COUNT
public void prepare(Map stormConf, org.apache.storm.task.TopologyContext context, org.apache.storm.task.OutputCollector collector)
prepare
in interface org.apache.storm.task.IBolt
public void execute(org.apache.storm.tuple.Tuple input)
execute
in interface org.apache.storm.task.IBolt
public void cleanup()
cleanup
in interface org.apache.storm.task.IBolt
public void declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer)
declareOutputFields
in interface org.apache.storm.topology.IComponent
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.