[jira] [Created] (FLINK-18873) Make the WatermarkStrategy API more scala friendly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-18873) Make the WatermarkStrategy API more scala friendly

Shang Yuanchun (Jira)
Dawid Wysakowicz created FLINK-18873:
----------------------------------------

             Summary: Make the WatermarkStrategy API more scala friendly
                 Key: FLINK-18873
                 URL: https://issues.apache.org/jira/browse/FLINK-18873
             Project: Flink
          Issue Type: Improvement
          Components: API / Core, API / DataStream
    Affects Versions: 1.11.0
            Reporter: Dawid Wysakowicz
             Fix For: 1.12.0


Right now there is no reliable way of passing WatermarkGeneratorSupplier and/or TimestampAssigner as lambdas in scala.

The only way to use this API is:

{code}
    .assignTimestampsAndWatermarks(
      WatermarkStrategy.forGenerator[(String, Long)](
        new WatermarkGeneratorSupplier[(String, Long)] {
          override def createWatermarkGenerator(context: WatermarkGeneratorSupplier.Context): WatermarkGenerator[(String, Long)] =

            new MyPeriodicGenerator
        }
      )
        .withTimestampAssigner(new SerializableTimestampAssigner[(String, Long)] {
          override def extractTimestamp(t: (String, Long), l: Long): Long = t._2
        })
    )
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)