onEventTime() is not called after setting ctx.registerEventTimeTimer(timstamp)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

onEventTime() is not called after setting ctx.registerEventTimeTimer(timstamp)

Hung
This post was updated on .
Hi Flink users,

Can I ask is my understanding of onEventTime() correct?

In my custom trigger, I have sth as follows:

onElement(JSONObject element, long timestamp, W window, TriggerContext ctx){
    if(count == 3) {
       ctx.registerEventTimeTimer(ctx.ctx.getCurrentWatermark()+100000);
       return TriggerResult.Continue;
  }
}

onEventTime(long time, W window, TriggerContext ctx){
      return TriggerResult.FIRE_AND_PURGE;
}

and I expect onEventTime(long time, W window, TriggerContext ctx) will be called when watermark has passed 100000 millis.

but nothing happens,,,did I misunderstand sth?

Best,

Sendoh
Reply | Threaded
Open this post in threaded view
|

Re: onEventTime() is not called after setting ctx.registerEventTimeTimer(timstamp)

Aljoscha Krettek
Hi,
onEventTime() will be called when the watermark passes <current watermark> + 100_000, where <current watermark> is the watermark at the time when you set the timer. Does the watermark advance that far?

Cheers,
Aljoscha

On Thu, 8 Dec 2016 at 01:51 Sendoh <[hidden email]> wrote:
Hi Flink users,

Can I ask is my understanding of onEventTime() correct?

In my custom trigger, I have sth as follows:

onElement(JSONObject element, long timestamp, W window, TriggerContext ctx){
    if(count == 3) {
       ctx.registerEventTimeTimer(ctx.getWatermark+100000);
       return TriggerResult.Continue;
  }
}

onEventTime(long time, W window, TriggerContext ctx){
      return TriggerResult.FIRE_AND_PURGE;
}

and I expect onEventTime(long time, W window, TriggerContext ctx) will be
called when watermark has passed 100000 millis.

but nothing happens,,,did I misunderstand sth?

Best,

Hung Chang



--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/onEventTime-is-not-called-after-setting-ctx-registerEventTimeTimer-timstamp-tp10509.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.