@Note

Documentation

VoltDB Home » Documentation » Using VoltDB

@Note

@Note — Writes a message into the VoltDB log file.

Synopsis

@Note String message

Description

The @Note system procedure lets you write arbitrary text into the VoltDB log file as an INFO level message. Adding messages to the log file can be useful when debugging issues with your application. For example, you can write a message when a new process starts and again when it ends, to see if it generates any unusual error messages between the two notes. You can also use this procedure to document administrative actions taken on the system, such as updating the configuration or changing the schema.

When security is enabled, the process or user must have admin permissions to be able to write to the log file. Otherwise, the procedure call returns an error indicating you do not have permission to complete the request.

The @Note system procedure lets you write to the log from within your application. To perform the same task interactively, you can execute @Note from the sqlcmd prompt or by using the voltadmin note command.

Return Values

Returns one VoltTable with one row

NameDatatypeDescription
STATUSBIGINTAlways returns the value zero (0) indicating success.

Example

The following program example uses @Note to write a message into the log file before and after performing a large series of delete operations.

client.callProcedure("@Note", "Starting database cleanup...");

   /* Code to delete obsolete records */

    [ . . . ]

client.callProcedure("@Note", "Database cleanup completed.");

The following example uses the voltadmin note command to perform the same function when running a cleanup program interactively. (Note the use of single quotes to enclose the message text to avoid punctuation being accidentally interpreted by the command shell).

$ voltadmin note 'Starting database cleanup...'
$ java MyCleanupProgram
$ voltadmin note 'Database cleanup completed.'