https://github.com/nathanmarz/storm/wiki/Guaranteeing-message-processing这篇文章介绍了storm如何处理消息事务,提到了用一个ack value代表一个tuple的生命周期。
其算法是“It is simply the xor of all tuple ids that have been created and/or acked in the tree.”
如果topology是
Spout->A->B
,那么计算过程应该是
(0^U(s))^(U(s)^U(A))^(U(A)^0)=0
U(s)代表spout创建的tuple id.也就是tuple创建时和ack时都要XOR一次,当所有component都处理完时,结果值是0.最后一个bolt没有下游bolt时为0.
本文深入探讨了Storm中消息事务处理机制,通过一个ackvalue代表每个tuple的生命周期,并使用XOR运算计算整个流程的最终状态。对于拓扑结构如Spout->A->B,通过计算U(s)、U(s)^U(A)、(U(s)^U(A))^0得出最终值为0,体现了所有组件处理完毕的标志。
800

被折叠的 条评论
为什么被折叠?



