You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Don Frascuchon <fr...@gmail.com> on 2015/12/22 15:16:21 UTC

Scala API and sources with timestamp

Hello,

There is a way for define  a EventTimeSourceFunction with anonymous
functions from the scala api?  Like that:

 env.addSource[Int] {
  ctx => {

  ...

ctx.collectWithTimestamp(i, System.currentTimeMillis())
...

  }

}

Thanks in advance!

Re: Scala API and sources with timestamp

Posted by Till Rohrmann <tr...@apache.org>.
Hi Don,

yes that's exactly how you use an anonymous function as a source function.

Cheers,
Till

On Tue, Dec 22, 2015 at 3:16 PM, Don Frascuchon <fr...@gmail.com>
wrote:

> Hello,
>
> There is a way for define  a EventTimeSourceFunction with anonymous
> functions from the scala api?  Like that:
>
>  env.addSource[Int] {
>   ctx => {
>
>   ...
>
> ctx.collectWithTimestamp(i, System.currentTimeMillis())
> ...
>
>   }
>
> }
>
> Thanks in advance!
>