A bolt's lifecycle is as follows:
IBolt object created on client machine. The IBolt is serialized into the topology (using Java serialization) and submitted to the master machine of the cluster (Nimbus). Nimbus then launches workers which deserialize the object, call prepare on it, and then start processing tuples.
If you want to parameterize an IBolt, you should set the parameter's through its constructor and save the parameterization state as instance variables (which will then get serialized and shipped to every task executing this bolt across the cluster).
When defining bolts in Java, you should use the IRichBolt interface which adds necessary methods for using the Java TopologyBuilder API.
|
|
|
|