简体   繁体   English

风暴埃斯珀螺栓元组锚定

[英]Storm Esper Bolt Tuple Anchoring

I currently have a topology set up that makes use of an Esper Bolt created by tomdz on GitHub. 目前,我已经建立了一个拓扑,该拓扑利用了由GitHub上的tomdz创建的Esper Bolt。 Everything appears to work fine except when it comes to tuple anchoring. 除了涉及元组锚定之外,其他所有内容似乎都可以正常工作。

In the Esper Bolt itself there is a callback: 在Esper Bolt本身中有一个回调:

public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPServiceProvider epServiceProvider)

The problem here is that I do not have a reference to the previous tuple in the tuple tree. 这里的问题是我没有对元组树中的前一个元组的引用。 This means when I go to emit my Esper result to the next Bolt in the sequence, I am unable to provide a tuple for anchoring: 这意味着当我要向序列中的下一个Bolt发送Esper结果时,我无法提供用于锚定的元组:

collector.emit(new Values(eventName, eventGrouping, eventDescription, correlatedValues));

Wondering if anyone has encountered this issue in their own project? 想知道是否有人在自己的项目中遇到此问题? If so how did you get around this? 如果是这样,您如何解决这个问题? I want to use anchoring to ensure message reliability throughout my topology. 我想使用锚定来确保整个拓扑中消息的可靠性。

One option is to attach the Storm tuple to the Esper input event as a property and make sure the Esper EPL selects the property either by "select *" or "select originaltuple". 一种选择是将Storm元组作为属性附加到Esper输入事件,并确保Esper EPL通过“选择*”或“选择原始元组”选择属性。 The listener can then use that. 然后,侦听器可以使用它。

The other option is to track this outside of Esper by using some event id that you may have. 另一个选择是通过使用您可能拥有的某些事件ID在Esper之外跟踪此事件。 Or use the input event identity via identity hashmap mapping the input event to the tuple. 或通过将输入事件映射到元组的标识哈希图使用输入事件标识。 The listener would then need to do some lookup based on the Esper input event that is the same reference that Esper also delivers to the listener, and remove. 然后,侦听器将需要根据Esper输入事件进行一些查找,该事件与Esper也提供给侦听器的引用相同,然后将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM