我写了一个这样的简单模式
Pattern<JoinedEvent, ?> pattern = Pattern.<JoinedEvent>begin("start")
.where(new SimpleCondition<JoinedEvent>() {
@Override
public boolean filter(JoinedEvent streamEvent) throws Exception {
return streamEvent.getRRInterval()>= 10 ;
}
}).within(Time.milliseconds(WindowLength));
它在 IntellijIdea 中运行良好。我在仪表板和 IntelliJ-Idea 中都使用 Flink 1.3.2。当我从源代码构建 Flink 时,我看到了很多警告消息,这些消息让我相信迭代条件类没有包含在 jar 中,因为错误也说ClassNotFoundException
。下面是错误
Caused by: java.lang.NoClassDefFoundError: org/apache/flink/cep/pattern/conditions/IterativeCondition
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at
org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:492)
... 38 more
Caused by: java.lang.ClassNotFoundException: org.apache.flink.cep.pattern.conditions.IterativeCondition
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 44 more