Package io.siddhi.core.debugger
Class SiddhiDebugger
- java.lang.Object
-
- io.siddhi.core.debugger.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSiddhiDebugger.QueryTerminalSiddhiDebugger allows to add breakpoints only at the beginning and the end of a query.
-
Constructor Summary
Constructors Constructor Description SiddhiDebugger(SiddhiAppContext siddhiAppContext)Create a new SiddhiDebugger instance for the givenSiddhiAppContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquireBreakPoint(String queryName, SiddhiDebugger.QueryTerminal queryTerminal)Acquire the given breakpoint.voidcheckBreakPoint(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.Map<String,Object>getQueryState(String queryName)Get all the event states stored in the given query.voidnext()Release the current lock and wait for the events arrive to the next point.voidplay()Release the current lock and wait for the next event arrive to the same break point.voidreleaseAllBreakPoints()Release all the breakpoints from the Siddhi debugger.voidreleaseBreakPoint(String queryName, SiddhiDebugger.QueryTerminal queryTerminal)Release the given breakpoint from the SiddhiDebugger.voidsetDebuggerCallback(SiddhiDebuggerCallback siddhiDebuggerCallback)A callback to be called by the Siddhi debugger when reaching an active breakpoint.
-
-
-
Constructor Detail
-
SiddhiDebugger
public SiddhiDebugger(SiddhiAppContext siddhiAppContext)
Create a new SiddhiDebugger instance for the givenSiddhiAppContext.- 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 queryqueryTerminal- 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 queryqueryTerminal- 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 queryqueryTerminal- IN or OUT endpoint of the querycomplexEvent- theComplexEventwhich 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
-
-