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

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

问题描述

风暴文档中提到,风暴重放处理已超时的元组.我的问题是,风暴是否自动执行此操作(没有在原始 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)?

推荐答案

为了在超时时正确重放,您必须在从 spout 发出元组时使用 id 锚定元组.当超时发生时,您用作锚点的任何内容都将返回到失败方法 (fail(object anchorId)).现在,您可以使用失败/超时元组的 anchorId 来重播或使用超时元组执行任何其他操作.每个锚 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天全站免登陆