Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated design

...

Eagle Topology failed to Start if it finds invalid Policy.


Proposed Design

#1 Identifying an invalid query (using SiddhiCompiler)

...

The method will check if the given input expression is valid wrt expected syntax. If the policy is found to be invalid, it will throw SiddhiParserException with mentioning the error in the query. Based on this method output, we can define markdown status and markdown reason for the query corresponding to its policy.


#2 Updating Markdown details for the Policy in HBase

...

When the topology starts, the AlertExecutor.init() will be called to populate the map of PolicyEvaluators. The map is updated regularly at one of these methods - init(), onPolicyCreated(), onPolicyChanged() and onPolicyDeleted(). At this point before making any change to the map, we could check for the validity of the policy and then update it accordingly in the HBase tabled against the policyID. Also based on the output of the validation process, we can add/update/remove AlertExecutors from the map which will be used later in the flow to validate the incoming data event against the required policies.

 

 

 

 

 


#3 Updating SiddhiRuntime Dynamically

Approach #1

For every change made in the policy end at run time (includes new policy, update existing policy), a new SiddhiRuntime is created (SiddhiPolicyEvaluator.createSiddhiRuntime()) based on the newly available SiddhiPolicyDefinition object and updated accordingly for the PolicyEvaluator in the background (without changing the PolicyEvaluator map available in the AlertExecutor). So at the run time creation, we check if the policy is valid or invalid by SiddhiCompiler.parseQuery() and update the SiddhiRuntime object for that PolicyEvaluator accordingly.

The will work on a per PolicyEvaluator basis.