Apache Flink 1.0.0是否支持引用方法?

时间:2016-03-25 08:21:07

标签: apache-flink

此代码可以正常工作:

.keyBy(value -> value.getSessionUid())

但是这个

.keyBy(LogItem::getSessionUid)

抛出异常:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
    at org.apache.flink.api.java.typeutils.TypeExtractor.getUnaryOperatorReturnType(TypeExtractor.java:294)
    at org.apache.flink.api.java.typeutils.TypeExtractor.getKeySelectorTypes(TypeExtractor.java:253)
    at org.apache.flink.api.java.typeutils.TypeExtractor.getKeySelectorTypes(TypeExtractor.java:246)
    at org.apache.flink.streaming.api.datastream.KeyedStream.<init>(KeyedStream.java:87)
    at org.apache.flink.streaming.api.datastream.DataStream.keyBy(DataStream.java:241)
    at streamer_sessions_aggregator.StreamerSessionAggregator.runFlow(StreamerSessionAggregator.java:40)
    at streamer_sessions_aggregator.Main.main(Main.java:10)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

据我所知,Apache Flink 1.0.0现在不支持参考方法。正确?

1 个答案:

答案 0 :(得分:1)

Flink does currently not support reference methods. Here is the JIRA to add support for it: https://issues.apache.org/jira/browse/FLINK-3138