vanrzk
vanrzk

Reputation: 11

Taking a snapshot of a sequence/pattern query in Siddhi

I am currently working on a mechanism to extract the intermediate states of CEP queries, so that I can use this information to restore the query state at a later point in time (for example, after node failure).

Extracing intermediate state works fine for window-based (e.g., timeBatch query) or aggregate-based queries (e.g., sum), given that I can create a custom window/aggregate function and extract the intermediate state (for example, the current events in the window or the current sum).

Even for a sequence/pattern query, I can see how extracting the intermediate state can be useful for restoration purposes. For example, if I have a pattern query where I look for A -> B -> C, and so far, A -> B has already been recognised, I can try extracting this sub-pattern as part of a query snapshot. Later, upon restoration, I only need to search for the events of type C to satisfy the pattern.

So far, I have not come across a viable approach of extracting this information. Does anyone have any ideas on how I can go about this issue? Thanks!

Upvotes: 0

Views: 105

Answers (1)

Grainier
Grainier

Reputation: 1654

You can start by referring to SnapshotService, which can be used to get the current serialized states of queries.

Upvotes: 0

Related Questions