Scala API and sources with timestamp

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

Scala API and sources with timestamp

Francis Aranda
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! 
Reply | Threaded
Open this post in threaded view
|

Re: Scala API and sources with timestamp

Till Rohrmann
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 <[hidden email]> 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!