风暴重播元组哪个处理已超时? [英] Does storm replay tuple which processing has timed out?

查看:121
本文介绍了风暴重播元组哪个处理已超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在风暴文档中提到,风暴重放了处理超时的元组。我的问题是风暴是否自动执行此操作(不调用原始spout上的fail())或者是原始spout的重要责任是重放元组(调用fail()并且重放应该在内部实现,甚至在外部实现)?

It's mentioned in the storm documentation, that storm replays tuple which processing has timed out. My question is if the storm do this automatically (without calling fail() on the origin spout) or is this rather responsibility of the origin spout to replay the tuple (the fail() is called and replay should be implemented inside or even somewhere externally)?

推荐答案

为了在超时时进行适当的重放,你必须在发出它时使用id锚定元组从鲸鱼喷水。发生超时时,无论您用作锚点的是什么,都会返回到fail方法(fail(object anchorId))。现在,您可以使用failed / timedout元组的anchorId进行重放,或使用超时元组执行的任何其他操作。每个锚ID必须是唯一的。锚id的示例是数据库id。当元组失败时,您可以使用数据库ID重新创建元组并重新发出它。因此,要回答您的问题,您必须在失败中使用重播逻辑,并且可以使用anchorId重新创建元组。希望此信息有助于

In order to have a proper replay on a timeout, you must anchor the tuple with an id when you emit it from the spout. When the timeout occurs, whatever you used as an anchor is returned to the fail method (fail(object anchorId)). Now you can use the anchorId of the failed/timedout tuple to replay or anything else you want to do with the timeout tuple. Each anchor id must be unique. An example of an anchor id is a database id. When you tuple fails, you can use the databse id to recreate your tuple and re-emit it. So to answer your question you must have your replay logic inside the fail and you can use the anchorId to recreate your tuple. Hope this info helps

这篇关于风暴重播元组哪个处理已超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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