风暴程序的执行流程 [英] Execution flow of a storm program
问题描述
我是新手,试图了解从spout
到bolt
的不同方法的执行流程.
像spout一样有不同的方法
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()
nextTuple()
open()
declareOutputFields()
declareOutputFields()
activate()
activate()
deactivate()
deactivate()
和bolt具有类似
prepare()
prepare()
execute()
cleanup()
declareOutputFields()
declareOutputFields()
那么有人能告诉我这些方法的执行顺序吗?
so can anyone tell me the sequence of execution of these methods ?
推荐答案
首先,当您的拓扑启动时...
First, when your topology is started...
- 创建喷口和螺栓
-
declareOutputFields
- 喷口/螺栓序列化并分配给工人
第二,在集群中某个位置的每个工作人员中……
Second, in each worker somewhere on the cluster...
- 喷口
open
和螺栓prepare
(发生一次) - 循环中...
- 喷口呼叫
ack
,fail
和nextTuple
- 螺栓调用
execute
- 喷口呼叫
- Spouts
open
and Boltsprepare
(happens once) - In a loop...
- Spouts call
ack
,fail
, andnextTuple
- Bolts call
execute
- Spouts call
如果您的拓扑已停用...
If your topology is deactivated...
- 您的壶嘴
deactivate
方法将被调用.当您再次激活拓扑时,将调用activate
.
- Your spouts
deactivate
method will be called. When you activate the topology again thenactivate
will be called.
如果您的拓扑被杀死...
If your topology is killed...
- 喷口可能被称为
close
- 螺栓可能被称为
cleanup
- Spouts might have
close
called - Bolts might have
cleanup
called
注意:
没有保证人会被要求关闭,因为 主管在群集上杀死-9的工作进程. 源
There is no guarentee that close will be called, because the supervisor kill -9's worker processes on the cluster. source
这篇关于风暴程序的执行流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!