ProcessWindowFunction在不同的程序包中有何区别?何时何地使用哪个程序包?
对于Apache Flink: ProcessWindowFunction implementation中的窗口操作, org.apache.flink.streaming.api.scala 是正确的使用方法,但找不到Flink 1.8 API文档,仅针对1.3。
如果我使用 org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction ,则会收到错误消息。
Error:(66, 20) type mismatch;
found : com.dataartisans.flinktraining.exercises.datastream_scala.windows.HourlyTipProcessFunction
required: org.apache.flink.streaming.api.scala.function.ProcessWindowFunction[com.dataartisans.flinktraining.exercises.datastream_java.datatypes.TaxiFare,?,org.apache.flink.api.java.tuple.Tuple,org.apache.flink.streaming.api.windowing.windows.TimeWindow]
.process(new HourlyTipProcessFunction())
VERSION =“ 18.04.2 LTS(Bionic Beaver)”
pom.xml<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.19</slf4j.version>
<flink.version>1.8.0</flink.version>
<scala.binary.version>2.12</scala.binary.version>
<junit.version>4.12</junit.version>
</properties>
答案 0 :(得分:2)
org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction是KeyedStreams上ProcessWindowFunctions的Java API类。
org.apache.flink.streaming.api.scala.function.ProcessWindowFunction相同,但适用于Scala API。
ProcessAllWindowFunction用于非键流上的Windows。