public class OutputBolt
extends org.apache.storm.topology.base.BaseRichBolt
Receives <colIndex, colProduct>
tuples, computes the final column product for each colIndex, records the results in the final Response object, and
outputs the final Response object for the query.
Flush signals are sent to the OuputBolt from the EncColMultBolts via a tuple of the form <-1, 0>
. Once a flush signal has been received from each
EncColMultBolt (or a timeout is reached), the final column product is computed and the final Response is formed and emitted.
Currently, the Responses are written to HDFS to location specified by the outputFile with the timestamp appended.
TODO: -- Enable other Response output locations
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.CountDownLatch |
latch |
Constructor and Description |
---|
OutputBolt() |
Modifier and Type | Method and Description |
---|---|
void |
declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer outputFieldsDeclarer) |
void |
execute(org.apache.storm.tuple.Tuple tuple) |
void |
prepare(java.util.Map map,
org.apache.storm.task.TopologyContext topologyContext,
org.apache.storm.task.OutputCollector collector) |
public void prepare(java.util.Map map, org.apache.storm.task.TopologyContext topologyContext, org.apache.storm.task.OutputCollector collector)
public void execute(org.apache.storm.tuple.Tuple tuple)
public void declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer outputFieldsDeclarer)