生命周期主要是SPOUT和Bolt这二个组件的生命周期
Spout组件涉及到的方法有:
declareOutputFields()
open()
active()
nextTuple()
disactive()
Bolt组件涉及到的方法有
declareOutputFileds()
prepare()
execute()
什么时候执行?
在客户端将jar包提交到集群上的时候,执行
spout和bolt的构造方法以及declareOutputFields()
在将jar包提交到集群以后:
spout执行open方法一次,得到conf一些配置信息
active 让处理的信息发送到bolt中
nextTuple不断的循环执行
bolt组件中
prepare()方法只执行一次
execute()执行多次