风暴程序的执行流程 [英] Execution flow of a storm program

查看:102
本文介绍了风暴程序的执行流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,试图了解从spoutbolt的不同方法的执行流程. 像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...

  1. 创建喷口和螺栓
  2. declareOutputFields
  3. 喷口/螺栓序列化并分配给工人

第二,在集群中某个位置的每个工作人员中……

Second, in each worker somewhere on the cluster...

  1. 喷口open和螺栓prepare(发生一次)
  2. 循环中...
    • 喷口呼叫ackfailnextTuple
    • 螺栓调用execute
  1. Spouts open and Bolts prepare (happens once)
  2. In a loop...
    • Spouts call ack, fail, and nextTuple
    • Bolts call execute


如果您的拓扑已停用...


If your topology is deactivated...

  • 您的壶嘴deactivate方法将被调用.当您再次激活拓扑时,将调用activate.
  • Your spouts deactivate method will be called. When you activate the topology again then activate 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆