apache-storm – 经过一段时间后你会如何发布风暴数据?

例如,假设您使用storm来聚合Web访问的开始和结束日期.会话从用户的第一次访问开始,并在该同一用户不活动30分钟后结束.这些数据在收集时实时流入风暴.在30分钟不活动后,您如何告诉风暴发出数据? 最佳答案 我不确定但您可以在风暴中查找TOPOLOGY_TICK_TUPLE_FREQ_SECS属性.如在
this article中找到的

Tick tuples: It’s common to require a bolt to “do something” at a fixed interval, like flush writes to a database. Many people have been using variants of a ClockSpout to send these ticks. The problem with a ClockSpout is that you can’t internalize the need for ticks within your bolt, so if you forget to set up your bolt correctly within your topology it won’t work correctly. 0.8.0 introduces a new “tick tuple” config that lets you specify the frequency at which you want to receive tick tuples via the “topology.tick.tuple.freq.secs” component-specific config, and then your bolt will receive a tuple from the __system component and __tick stream at that frequency.

您还可以找到示例代码来配置spouts或bolt以接收具有特定间隔的tick元组.

点赞