LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
LogCabin::Client::TestingCallbacks Class Reference

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>

List of all members.

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.

Detailed Description

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.

Definition at line 592 of file Client.h.


Constructor & Destructor Documentation

Constructor.

Does nothing.

Definition at line 484 of file Client.cc.

Destructor.

Does nothing.

Definition at line 488 of file Client.cc.


Member Function Documentation

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.

Parameters:
[in,out]requestProtocol 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]responseProtocol buffer where response details should be filled in if true is returned.
Returns:
True if handled, false to query the in-memory data structure.

Definition at line 493 of file Client.cc.

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.

Parameters:
[in,out]requestProtocol 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]responseProtocol buffer where response details should be filled in if true is returned.
Returns:
True if handled, false to query the in-memory data structure.

Definition at line 501 of file Client.cc.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines