The interface implemented by applications to handle error, informational and progress messages. More...
Public Attributes | |
int(* | handle_error )(WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const char *message) |
Callback to handle error messages; by default, error messages are written to the stderr stream. More... | |
int(* | handle_message )(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *message) |
Callback to handle informational messages; by default, informational messages are written to the stdout stream. More... | |
int(* | handle_progress )(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *operation, uint64_t progress) |
Callback to handle progress messages; by default, progress messages are not written. More... | |
int(* | handle_close )(WT_EVENT_HANDLER *handler, WT_SESSION *session, WT_CURSOR *cursor) |
Callback to handle automatic close of a WiredTiger handle. More... | |
int(* | handle_general )(WT_EVENT_HANDLER *handler, WT_CONNECTION *wt_conn, WT_SESSION *session, WT_EVENT_TYPE type, void *arg) |
Callback to handle general events. More... | |
The interface implemented by applications to handle error, informational and progress messages.
Entries set to NULL are ignored and the default handlers will continue to be used.
int(* WT_EVENT_HANDLER::handle_close) (WT_EVENT_HANDLER *handler, WT_SESSION *session, WT_CURSOR *cursor) |
Callback to handle automatic close of a WiredTiger handle.
Close handler returns are not ignored: if the handler returns non-zero, the error may cause the WiredTiger function posting the event to fail, and may even cause operation or library failure.
session | The session handle that is being closed if the cursor parameter is NULL. |
cursor | The cursor handle that is being closed, or NULL if it is a session handle being closed. |
int(* WT_EVENT_HANDLER::handle_error) (WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const char *message) |
Callback to handle error messages; by default, error messages are written to the stderr stream.
See Message handling using the WT_EVENT_HANDLER for more information.
Errors that require the application to exit and restart will have their error
value set to WT_PANIC
. The application can exit immediately when WT_PANIC
is passed to an event handler; there is no reason to return into WiredTiger.
Event handler returns are not ignored: if the handler returns non-zero, the error may cause the WiredTiger function posting the event to fail, and may even cause operation or library failure.
session | the WiredTiger session handle in use when the error was generated. The handle may have been created by the application or automatically by WiredTiger. |
error | a return value from a WiredTiger, ISO C, or POSIX standard API call, which can be converted to a string using WT_SESSION::strerror |
message | an error string |
int(* WT_EVENT_HANDLER::handle_general) (WT_EVENT_HANDLER *handler, WT_CONNECTION *wt_conn, WT_SESSION *session, WT_EVENT_TYPE type, void *arg) |
Callback to handle general events.
The application may choose to handle only some types of events. An unhandled event should return 0.
General event returns are not ignored in most cases. If the handler returns non-zero, the error may cause the WiredTiger function posting the event to fail.
wt_conn | The connection handle for the database. |
session | the WiredTiger session handle in use when the progress message was generated. The handle may have been created by the application or automatically by WiredTiger or may be NULL. |
type | A type indicator for what special event occurred. |
arg | A generic argument that has a specific meaning depending on the event type. (see WT_EVENT_TYPE for available options.) |
int(* WT_EVENT_HANDLER::handle_message) (WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *message) |
Callback to handle informational messages; by default, informational messages are written to the stdout stream.
See Message handling using the WT_EVENT_HANDLER for more information.
Message handler returns are not ignored: if the handler returns non-zero, the error may cause the WiredTiger function posting the event to fail, and may even cause operation or library failure.
session | the WiredTiger session handle in use when the message was generated. The handle may have been created by the application or automatically by WiredTiger. |
message | an informational string |
int(* WT_EVENT_HANDLER::handle_progress) (WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *operation, uint64_t progress) |
Callback to handle progress messages; by default, progress messages are not written.
See Message handling using the WT_EVENT_HANDLER for more information.
Progress handler returns are not ignored: if the handler returns non-zero, the error may cause the WiredTiger function posting the event to fail, and may even cause operation or library failure.
session | the WiredTiger session handle in use when the progress message was generated. The handle may have been created by the application or automatically by WiredTiger. |
operation | a string representation of the operation |
progress | a counter |