Debugging VOLT DB Stored Procedure

旧街凉风 提交于 2019-12-11 09:24:45

问题


I have voltdb installed in a remote machine. I would like to know how I can debug a stored procedure I write. To be specific I would like to see the values of different variables at different points of time. Is there any logging mechanism or displaying the content on the terminal (like raise notice in netizza).


回答1:


This wiki page, Using Eclipse to Develop and Debug VoltDB Client Applications, on the voltdb project in Github describes how to set this up with the debugger in Eclipse.

If you're looking for something dead simple for command line troubleshooting, there are a few options, but we don't recommend adding calls to log4j in stored procedures. This is for temporary use, and should be removed afterwards:

  1. Use System.out.println() calls in the procedure, and run VoltDB from the console to see the output. Call the procedure manually. If you make a lot of calls to the procedure, this won't be very helpful.

  2. Create a table and use inserts in the procedure to log messages, variable values, or whatever you want to track within the procedure. This can handle lots of calls, as you can query the table after running a workload, and even create a view to aggregate the results. I've used this more for things like counting nanoseconds elapsed within the execution of the procedure at various points, counting instances when certain logical points were reached within the procedure, or for counting intermediate records returned within the procedure, generally only for very complex procedures. It won't help if your procedure is resulting in an error because the inserts would be rolled back, so this has limited use.



来源:https://stackoverflow.com/questions/27797637/debugging-volt-db-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!