我想ProcessWindowFunction
在我的 Apache Flink 项目中使用 a 。但是我在使用过程功能时遇到了一些错误,请参见下面的代码片段
错误是:
WindowedStream,Tuple,TimeWindow> 类型中的方法 process(ProcessWindowFunction,R,Tuple,TimeWindow>) 不适用于参数 (JDBCExample.MyProcessWindows)
我的程序:
DataStream<Tuple2<String, JSONObject>> inputStream;
inputStream = env.addSource(new JsonArraySource());
inputStream.keyBy(0)
.window(TumblingEventTimeWindows.of(Time.minutes(10)))
.process(new MyProcessWindows());
我的ProcessWindowFunction
:
private class MyProcessWindows
extends ProcessWindowFunction<Tuple2<String, JSONObject>, Tuple2<String, String>, String, Window>
{
public void process(
String key,
Context context,
Iterable<Tuple2<String, JSONObject>> input,
Collector<Tuple2<String, String>> out) throws Exception
{
...
}
}