@SnapshotStatus

Documentation

VoltDB Home » Documentation » Using VoltDB

@SnapshotStatus

@SnapshotStatus — Lists information about the most recent snapshots created from the current database.

Synopsis

@SnapshotStatus

Description

Warning

The @SnapshotStatus system procedure is being deprecated and may be removed in future versions. Please use the @Statistics "SNAPSHOTSTATUS" selector, which returns the same results, to retrieve information about recent snapshots.

The @SnapshotStatus system procedure provides information about up to ten of the most recent snapshots performed on the current database. The information provided includes the directory path and prefix for the snapshot, when it occurred and how long it took, as well as whether the snapshot was completed successfully or not.

@SnapshotStatus provides status of any snapshots, including both native and CSV snapshots, as well as manual, automated, and command log snapshots.

Note that @SnapshotStatus does not tell you whether the snapshot files still exist, only that the snapshot was performed. You can use the procedure @SnapshotScan to determine what snapshots are available.

Also, the status information is reset each time the database is restarted. In other words, @SnapshotStatus only provides information about the most recent snapshots since the current database instance was started.

Return Values

Returns one VoltTable with a row for every snapshot file in the recent snapshots performed on the cluster.

NameDatatypeDescription
TIMESTAMPBIGINTThe timestamp when the snapshot was initiated (in milliseconds).
HOST_IDINTEGERNumeric ID for the host node.
HOSTNAMESTRINGServer name of the host node.
TABLESTRINGThe name of the database table whose data the file contains.
PATHSTRINGThe directory path where the snapshot file resides.
FILENAMESTRINGThe file name.
NONCESTRINGThe unique identifier for the snapshot.
TXNIDBIGINTThe transaction ID of the snapshot.
START_TIMEBIGINTThe timestamp when the snapshot began (in milliseconds).
END_TIMEBIGINTThe timestamp when the snapshot was completed (in milliseconds).
SIZEBIGINTThe total size, in bytes, of the file.
DURATIONBIGINTThe length of time (in milliseconds) it took to complete the snapshot.
THROUGHPUTFLOATThe average number of bytes per second written to the file during the snapshot process.
RESULTSTRINGString value indicating whether the writing of the snapshot file was successful ("SUCCESS") or not ("FAILURE").

Examples

The following example uses @SnapshotStatus to display information about the most recent snapshots performed on the current database:

$ sqlcmd
1> exec @SnapshotStatus;

The following code example demonstrates how to perform the same function programmatically:

VoltTable[] results = null;

try { 
   results = client.callProcedure("@SnapshotStatus").getResults();
}
catch (Exception e) { e.printStackTrace(); }

for (VoltTable t: results) {
   System.out.println(t.toString()); 
}