调试VOLT DB存储过程 [英] Debugging VOLT DB Stored Procedure

查看:65
本文介绍了调试VOLT DB存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在远程计算机上安装了voltdb.我想知道如何调试编写的存储过程.具体来说,我想在不同的时间点查看不同变量的值.是否有任何日志记录机制或在终端上显示内容(如netizza中的引发通知).

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).

推荐答案

此Wiki页面,

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.

如果您正在寻找一些非常简单的命令行故障排除方法,则有一些选择,但是我们不建议在存储过程中添加对log4j的调用.这是供临时使用的,此后应删除:

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. 在过程中使用System.out.println()调用,然后从控制台运行VoltDB以查看输出.手动调用该过程.如果您对该程序进行了很多调用,这将不会很有帮助.

  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.

创建一个表并在过程中使用插入来记录消息,变量值或您要在过程中跟踪的任何内容.这可以处理大量调用,因为您可以在运行工作负荷后查询表,甚至可以创建视图以汇总结果.我将其更多地用于诸如在过程中各个点执行过程中经过的纳秒计数,在过程中达到某些逻辑点时对实例进行计数,或对过程中返回的中间记录进行计数(通常仅用于非常复杂的过程)之类的东西..如果您的过程导致错误,将无济于事,因为插入将回滚,因此使用范围有限.

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.

这篇关于调试VOLT DB存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆