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.

in topology conf:
conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, 10);

in bolt:

if ( tuple.getSourceStreamId().equals("__tick") ) {
    logger.info("recv TickTuple");
} else {
    //normal tuple
}



On Tue, Mar 11, 2014 at 6:51 PM, 鞠大升 <[email protected]> wrote:

> please search tick tuple
>
>
> On Tue, Mar 11, 2014 at 5:49 PM, Klausen Schaefersinho <
> [email protected]> wrote:
>
>> Hi,
>>
>> is there something like a clock spout that just periodically emits a tick
>> event to trigger other bolts?
>>
>>
>> Cheers,
>>
>> klaus
>>
>
>
>
> --
> dashengju
> +86 13810875910
> [email protected]
>



-- 
dashengju
+86 13810875910
[email protected]

Reply via email to