You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Klausen Schaefersinho <kl...@gmail.com> on 2014/03/11 10:49:11 UTC

Clock Spout

Hi,

is there something like a clock spout that just periodically emits a tick
event to trigger other bolts?


Cheers,

klaus

Re: Clock Spout

Posted by 鞠大升 <da...@gmail.com>.
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, 鞠大升 <da...@gmail.com> wrote:

> please search tick tuple
>
>
> On Tue, Mar 11, 2014 at 5:49 PM, Klausen Schaefersinho <
> klaus.schaefers@gmail.com> 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
> dashengju@gmail.com
>



-- 
dashengju
+86 13810875910
dashengju@gmail.com

Re: Clock Spout

Posted by 鞠大升 <da...@gmail.com>.
please search tick tuple


On Tue, Mar 11, 2014 at 5:49 PM, Klausen Schaefersinho <
klaus.schaefers@gmail.com> 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
dashengju@gmail.com