0

当我写一个storm topology时,我发现tuples的顺序并不总是和spout发出的一样。(spout的作用是一行一行地读取一个文件,然后把行发送到一个不带 Thread.sleep()的bolt ,所以这个过程会非常快)。

谁能告诉我如何确保喷口螺栓发出的元组的顺序?非常感谢!

4

1 回答 1

3

你可能想看看三叉戟拓扑

Trident solves this problem by doing two things:

    Each batch is given a unique id called the "transaction id". If a batch is retried it will have the exact same transaction id.
    State updates are ordered among batches. That is, the state updates for batch 3 won't be applied until the state updates for batch 2 have succeeded.
于 2013-07-26T23:33:23.527 回答