You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by Srivatsan vn <sr...@gmail.com> on 2014/05/25 16:15:40 UTC

How to create this sample topology?

Hi,
I have made up this requirement to understand the working of apache storm.

I have a file containing the sensor values like this

Sensor1Id|FieldVal

Sensor2Id|FieldVal

Lets say I would like to have a topology like this to achieve parallelism.
I have a spout *MySpout* to emit each sensor given above line, then have a
bolt to split the line into two words (SensorId and FieldVal) and send
sensorId to *SensorBolt* and field value to *FieldBolt*. SensorBolt will do
a lookup onto some database to get details about the sensor, and FieldBolt
will do validation on the fieldVal based on some specification (check if
its within range for example).
Now here is the requirement , if the validation condition in FieldBolt
fails, I should be able to notify the entire sensor line present in the
file along with the sensor details retrieved by the SensorBolt. How do I go
about this? Create additional bolts? How the notifying bolt will have the
entire line tuple that's emitted by the spout? How to aggregate the state
of FieldBolt and SensorBolt ?

Please help.

Thanks Srivatsan Nallazhagappan