Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/2367
Thanks for your contribution and apologies for the late review @mushketyk.
I think your implementation goes into the right direction and I really like the
testing.
I think what we still can and should improve is to pull out the
`MatchingBehaviour` out of the `SharedBuffer` and the `State`. The `NFA` should
be the only component which is responsible for the matching behaviour. I think
we can achieve this if we pimp the `SharedBuffer` a little bit.
So what should roughly happen is that the `NFA` removes computation states
which are not longer valid. Furthermore, we have to clean up the `SharedBuffer`
and remove `SharedBufferEntries` which depend on other `SharedBufferEntries`
which are no longer valid (e.g. due to `MatchingBehaviour.afterLast`).
So when you have a `SharedBufferEntry` representing a certain state which
is part of the currently matched sequence and `MatchingBehaviour.afterLast`,
then you have to find out all `SharedBufferEntries` which depend on this state
(children) and remove them. That you have to do until you reach the youngest
descendant. Currently we can only find the predecessors for a given
`SharedBufferEntry` but not the children. I think that would have to be added
in order to implement the different `MatchingBehaviours`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---