Reputation: 389
I am new in storm and trying to understand the flow of execution of different methods from spout
to bolt
.
Like spout has different methods like
nextTuple()
open()
declareOutputFields()
activate()
deactivate()
and bolt has methods like
prepare()
execute()
cleanup()
declareOutputFields()
so can anyone tell me the sequence of execution of these methods ?
Upvotes: 8
Views: 3185
Reputation: 7056
First, when your topology is started...
declareOutputFields
Second, in each worker somewhere on the cluster...
open
and Bolts prepare
(happens once)ack
, fail
, and nextTuple
execute
If your topology is deactivated...
deactivate
method will be called. When you activate the topology again then activate
will be called.If your topology is killed...
close
calledcleanup
calledNote:
There is no guarentee that close will be called, because the supervisor kill -9's worker processes on the cluster. source
Upvotes: 14