Hello.

Early I asked how can I get access to unmatched events in CEP Pattern (
https://lists.apache.org/thread/p7n507jvm5hw0xmpoh0lcf87gf3yk18p).

Unfortunately Biao Geng answered me, that "that currently there is no such
API to access the middle NFA state".

I have reviewed the realization of flink CEP library and got a proposal.

I added new ValueState, named unmatchedEvents, in CEPOperator (
https://github.com/apache/flink/blob/master/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java
).

Also I added new interface UnmatchedEventsHandler, like
TimedOutPartialMatchHandler (
https://github.com/apache/flink/blob/master/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/functions/TimedOutPartialMatchHandler.java
).

I put all events in umatchedEvents in bufferEvent(IN event, long
currentTime) method.

When CEPOperator starts processing match (or timeout match), it also
deletes matching events from unmatchedEvents state.

Then CEPOperator calls UnmatchedEventsHadler.processEvents(List<IN> events,
Context ctx) for processing inmatchedEvents.value().

You can look on realization of my proposal in my github fork
https://github.com/A-Kinski/flink/pull/1/files

Reply via email to