You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yun Gao (Jira)" <ji...@apache.org> on 2022/04/13 06:28:06 UTC

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

     [ https://issues.apache.org/jira/browse/FLINK-18873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yun Gao updated FLINK-18873:
----------------------------
    Fix Version/s: 1.16.0

> 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
>            Priority: Minor
>              Labels: auto-deprioritized-major
>             Fix For: 1.15.0, 1.16.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.20.1#820001)