LogCabin
|
When running in testing mode, these callbacks serve as a way for the application to interpose on requests and responses to inject failures and model dynamic scenarios. More...
#include <Client.h>
Public Member Functions | |
TestingCallbacks () | |
Constructor. | |
virtual | ~TestingCallbacks () |
Destructor. | |
virtual bool | stateMachineQuery (Protocol::Client::StateMachineQuery_Request &request, Protocol::Client::StateMachineQuery_Response &response) |
Handle a read-only state machine query, such as Tree::read or Tree::listDirectory. | |
virtual bool | stateMachineCommand (Protocol::Client::StateMachineCommand_Request &request, Protocol::Client::StateMachineCommand_Response &response) |
Handle a read-write state machine command, such as Tree::read or Tree::listDirectory. |
When running in testing mode, these callbacks serve as a way for the application to interpose on requests and responses to inject failures and model dynamic scenarios.
See Cluster's constructor for more information.
This is experimental and is not part of LogCabin's public API.
LogCabin::Client::TestingCallbacks::~TestingCallbacks | ( | ) | [virtual] |
bool LogCabin::Client::TestingCallbacks::stateMachineQuery | ( | Protocol::Client::StateMachineQuery_Request & | request, |
Protocol::Client::StateMachineQuery_Response & | response | ||
) | [virtual] |
Handle a read-only state machine query, such as Tree::read or Tree::listDirectory.
The default implementation just returns false.
[in,out] | request | Protocol buffer containing request details. You can modify this and return false to have a slightly different request executed against the in-memory data structure. |
[out] | response | Protocol buffer where response details should be filled in if true is returned. |
bool LogCabin::Client::TestingCallbacks::stateMachineCommand | ( | Protocol::Client::StateMachineCommand_Request & | request, |
Protocol::Client::StateMachineCommand_Response & | response | ||
) | [virtual] |
Handle a read-write state machine command, such as Tree::read or Tree::listDirectory.
The default implementation just returns false.
[in,out] | request | Protocol buffer containing request details. You can modify this and return false to have a slightly different request executed against the in-memory data structure. |
[out] | response | Protocol buffer where response details should be filled in if true is returned. |