Aitozi commented on a change in pull request #6205: [FLINK-9642]Reduce the 
count to deal with state during a CEP process
URL: https://github.com/apache/flink/pull/6205#discussion_r211592661
 
 

 ##########
 File path: 
flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/nfa/NFATestUtilities.java
 ##########
 @@ -66,22 +67,25 @@
                List<List<Event>> resultingPatterns = new ArrayList<>();
 
                SharedBuffer<Event> sharedBuffer = 
TestSharedBuffer.createTestBuffer(Event.createTypeSerializer());
-               for (StreamRecord<Event> inputEvent : inputEvents) {
-                       nfa.advanceTime(sharedBuffer, nfaState, 
inputEvent.getTimestamp());
-                       Collection<Map<String, List<Event>>> patterns = 
nfa.process(
-                               sharedBuffer,
-                               nfaState,
-                               inputEvent.getValue(),
-                               inputEvent.getTimestamp(),
-                               afterMatchSkipStrategy);
-
-                       for (Map<String, List<Event>> p: patterns) {
-                               List<Event> res = new ArrayList<>();
-                               for (List<Event> le: p.values()) {
-                                       res.addAll(le);
+
+               try (SharedBufferAccessor<Event> sharedBufferAccessor = 
sharedBuffer.getAccessor()) {
 
 Review comment:
   Fixed. Thanks for your carefully review 👍

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to