@Quiesce

Documentation

Home » Documentation » Using VoltDB

@Quiesce

@Quiesce — Waits for all queued export data to be written to the connector.

Synopsis

@Quiesce

Description

The @Quiesce system procedure waits for any queued export data to be written to the export connector before returning to the calling application. @Quiesce also does an fsync to ensure any pending export overflow is written to disk. This system procedure should be called after stopping client applications and before calling @Shutdown to ensure that all export activity is concluded before shutting down the database.

If export is not enabled, the procedure returns immediately.

Return Values

Returns one VoltTable with one row.

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

Examples

The following example calls @Quiesce using sqlcmd:

$ sqlcmd
1> exec @Quiesce;

The following program example uses drain and @Quiesce to complete any asynchronous transactions and clear the export queues before shutting down the database.

     // Complete all outstanding activities
try {
    client.drain();
    client.callProcedure("@Quiesce");
}
catch (Exception e) {
    e.printStackTrace();
}

     // Shutdown the database.
try {
    client.callProcedure("@Shutdown");
}
     // We expect an exception when the connection drops.
     // Report any other exception.
catch (org.voltdb.client.ProcCallException e) { }
catch (Exception e) { e.printStackTrace(); }