You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Adrian Mocanu <am...@verticalscope.com> on 2013/12/20 22:39:21 UTC

Tick Tuple

Hi everybody,
I'm trying to have sent tick tuples to a bolt I have.

In the bolt I have these methods
def execute(tuple: Tuple){
isTickTuple(tuple) match {
      case true =>
        println("TICK TUPLE FOUND")
      case false =>
        println("regular TUPLE FOUND")
}
}

  override def getComponentConfiguration(): java.util.Map[String,AnyRef] = {
    val conf = new Config()
    val tickFrequencyInSeconds = sendPeriodMs * 1000
    conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, Long.box(tickFrequencyInSeconds))
    conf
}

def isTickTuple(tuple:Tuple):Boolean = {
    tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) &&
      tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID)
}

The code never prints "TICK TUPLE FOUND" but in the log I do see that a tick tuple was received
  executor [INFO] Processing received message source: __system:-1, stream: __tick, id: {}, [30]

Why can't I find these tick tuples when running, but they appear in the log? Do tick tuples  have some special logic which makes them transparent to the bolt?
I use storm 0.8.X

-Adrian


RE: Tick Tuple

Posted by Adrian Mocanu <am...@verticalscope.com>.
Thanks!
It was something like that... there were settings overriding my delay in another place.
Storm contrib is such treasure chest :)

-A

From: Michael Rose [mailto:michael@fullcontact.com]
Sent: December-23-13 10:02 AM
To: user@storm.incubator.apache.org
Subject: RE: Tick Tuple


The issue is you've multiplied ticktuplems by 1000 vs dividing. So you're probably not waiting long enough ;)

If you need an alternate spout, see storm contrib. There's a halfway decent one.
On Dec 23, 2013 7:58 AM, "Adrian Mocanu" <am...@verticalscope.com>> wrote:
If anyone is interested, I've decided to make my own Tick Spout.

From: Adrian Mocanu [mailto:amocanu@verticalscope.com<ma...@verticalscope.com>]
Sent: December-20-13 4:39 PM
To: user@storm.incubator.apache.org<ma...@storm.incubator.apache.org>
Subject: Tick Tuple

Hi everybody,
I'm trying to have sent tick tuples to a bolt I have.

In the bolt I have these methods
def execute(tuple: Tuple){
isTickTuple(tuple) match {
      case true =>
        println("TICK TUPLE FOUND")
      case false =>
        println("regular TUPLE FOUND")
}
}

  override def getComponentConfiguration(): java.util.Map[String,AnyRef] = {
    val conf = new Config()
    val tickFrequencyInSeconds = sendPeriodMs * 1000
    conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, Long.box(tickFrequencyInSeconds))
    conf
}

def isTickTuple(tuple:Tuple):Boolean = {
    tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) &&
      tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID)
}

The code never prints "TICK TUPLE FOUND" but in the log I do see that a tick tuple was received
  executor [INFO] Processing received message source: __system:-1, stream: __tick, id: {}, [30]

Why can't I find these tick tuples when running, but they appear in the log? Do tick tuples  have some special logic which makes them transparent to the bolt?
I use storm 0.8.X

-Adrian


RE: Tick Tuple

Posted by Michael Rose <mi...@fullcontact.com>.
The issue is you've multiplied ticktuplems by 1000 vs dividing. So you're
probably not waiting long enough ;)

If you need an alternate spout, see storm contrib. There's a halfway decent
one.
On Dec 23, 2013 7:58 AM, "Adrian Mocanu" <am...@verticalscope.com> wrote:

>  If anyone is interested, I’ve decided to make my own Tick Spout.
>
>
>
> *From:* Adrian Mocanu [mailto:amocanu@verticalscope.com]
> *Sent:* December-20-13 4:39 PM
> *To:* user@storm.incubator.apache.org
> *Subject:* Tick Tuple
>
>
>
> Hi everybody,
>
> I’m trying to have sent tick tuples to a bolt I have.
>
>
>
> In the bolt I have these methods
>
> def execute(tuple: Tuple){
>
> isTickTuple(tuple) match {
>
>       case true =>
>
>         println("TICK TUPLE FOUND")
>
>       case false =>
>
>         println("regular TUPLE FOUND")
>
> }
>
> }
>
>
>
>   override def getComponentConfiguration(): java.util.Map[String,AnyRef] =
> {
>
>     val conf = new Config()
>
>     val tickFrequencyInSeconds = sendPeriodMs * 1000
>
>     conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS,
> Long.box(tickFrequencyInSeconds))
>
>     conf
>
> }
>
>
>
> def isTickTuple(tuple:Tuple):Boolean = {
>
>     tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) &&
>
>       tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID)
>
> }
>
>
>
> The code never prints “TICK TUPLE FOUND” but in the log I do see that a
> tick tuple was received
>
>   executor [INFO] Processing received message source: __system:-1, stream:
> __tick, id: {}, [30]
>
>
>
> Why can’t I find these tick tuples when running, but they appear in the
> log? Do tick tuples  have some special logic which makes them transparent
> to the bolt?
>
> I use storm 0.8.X
>
>
>
> -Adrian
>
>
>

RE: Tick Tuple

Posted by Adrian Mocanu <am...@verticalscope.com>.
If anyone is interested, I've decided to make my own Tick Spout.

From: Adrian Mocanu [mailto:amocanu@verticalscope.com]
Sent: December-20-13 4:39 PM
To: user@storm.incubator.apache.org
Subject: Tick Tuple

Hi everybody,
I'm trying to have sent tick tuples to a bolt I have.

In the bolt I have these methods
def execute(tuple: Tuple){
isTickTuple(tuple) match {
      case true =>
        println("TICK TUPLE FOUND")
      case false =>
        println("regular TUPLE FOUND")
}
}

  override def getComponentConfiguration(): java.util.Map[String,AnyRef] = {
    val conf = new Config()
    val tickFrequencyInSeconds = sendPeriodMs * 1000
    conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, Long.box(tickFrequencyInSeconds))
    conf
}

def isTickTuple(tuple:Tuple):Boolean = {
    tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) &&
      tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID)
}

The code never prints "TICK TUPLE FOUND" but in the log I do see that a tick tuple was received
  executor [INFO] Processing received message source: __system:-1, stream: __tick, id: {}, [30]

Why can't I find these tick tuples when running, but they appear in the log? Do tick tuples  have some special logic which makes them transparent to the bolt?
I use storm 0.8.X

-Adrian