Class SiddhiDebugger


  • public class SiddhiDebugger
    extends Object
    SiddhiDebugger adds checkpoints, remove checkpoints and provide traversal functions like next and play. The given operations are: - next: Debug the next checkpoint - play: Return to the same
    • Constructor Detail

      • SiddhiDebugger

        public SiddhiDebugger​(SiddhiAppContext siddhiAppContext)
        Create a new SiddhiDebugger instance for the given SiddhiAppContext.
        Parameters:
        siddhiAppContext - the SiddhiAppContext
    • Method Detail

      • acquireBreakPoint

        public void acquireBreakPoint​(String queryName,
                                      SiddhiDebugger.QueryTerminal queryTerminal)
        Acquire the given breakpoint.
        Parameters:
        queryName - name of the Siddhi query
        queryTerminal - IN or OUT endpoint of the query
      • releaseBreakPoint

        public void releaseBreakPoint​(String queryName,
                                      SiddhiDebugger.QueryTerminal queryTerminal)
        Release the given breakpoint from the SiddhiDebugger.
        Parameters:
        queryName - name of the Siddhi query
        queryTerminal - IN or OUT endpoint of the query
      • releaseAllBreakPoints

        public void releaseAllBreakPoints()
        Release all the breakpoints from the Siddhi debugger. This may required to before stopping the debugger.
      • checkBreakPoint

        public void checkBreakPoint​(String queryName,
                                    SiddhiDebugger.QueryTerminal queryTerminal,
                                    ComplexEvent complexEvent)
        Check for active breakpoint at the given endpoint and if there is an active checkpoint, block the thread and send the event for debug callback.
        Parameters:
        queryName - name of the Siddhi query
        queryTerminal - IN or OUT endpoint of the query
        complexEvent - the ComplexEvent which is waiting at the endpoint
      • next

        public void next()
        Release the current lock and wait for the events arrive to the next point. For this to work, the next endpoint is not required to be a checkpoint marked by the user. For example, if user adds breakpoint only for the IN of query 1, next will track the event in OUT of query 1.
      • play

        public void play()
        Release the current lock and wait for the next event arrive to the same break point.
      • setDebuggerCallback

        public void setDebuggerCallback​(SiddhiDebuggerCallback siddhiDebuggerCallback)
        A callback to be called by the Siddhi debugger when reaching an active breakpoint.
        Parameters:
        siddhiDebuggerCallback - the SiddhiDebuggerCallback
      • getQueryState

        public Map<String,​Object> getQueryState​(String queryName)
        Get all the event states stored in the given query.
        Parameters:
        queryName - name of the Siddhi query
        Returns:
        QueryState internal state of the query