LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Public Attributes
LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC Class Reference

This class intercepts LeaderRPC calls from ClientImpl. More...

Inheritance diagram for LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC:
LogCabin::Client::LeaderRPCBase

List of all members.

Classes

class  Call

Public Member Functions

 TreeLeaderRPC (std::shared_ptr< TestingCallbacks > callbacks)
Status call (OpCode opCode, const google::protobuf::Message &request, google::protobuf::Message &response, TimePoint timeout)
 Execute an RPC on the cluster leader.
std::unique_ptr
< LeaderRPCBase::Call
makeCall ()
 Return a new Call object.

Public Attributes

std::recursive_mutex mutex
 Prevents concurrent access to callbacks and tree.
std::shared_ptr< TestingCallbackscallbacks
LogCabin::Tree::Tree tree

Detailed Description

This class intercepts LeaderRPC calls from ClientImpl.

It's used to mock out the Tree RPCs by processing them directly.

Definition at line 52 of file MockClientImpl.cc.


Constructor & Destructor Documentation

LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::TreeLeaderRPC ( std::shared_ptr< TestingCallbacks callbacks) [inline, explicit]

Definition at line 54 of file MockClientImpl.cc.


Member Function Documentation

Status LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::call ( OpCode  opCode,
const google::protobuf::Message &  request,
google::protobuf::Message &  response,
TimePoint  timeout 
) [inline, virtual]

Execute an RPC on the cluster leader.

This class guarantees that the RPC will be executed at least once.

Parameters:
opCodeRPC operation code. The caller must guarantee that this is a valid opCode. (If the server rejects it, this will PANIC.)
requestThe parameters for the operation. The caller must guarantee that this is a well-formed request. (If the server rejects it, this will PANIC.)
timeoutAfter this time has elapsed, stop waiting and return TIMEOUT. In this case, response will be left unmodified.
[out]responseThe response to the operation will be filled in here.

Implements LogCabin::Client::LeaderRPCBase.

Definition at line 60 of file MockClientImpl.cc.

std::unique_ptr<LeaderRPCBase::Call> LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::makeCall ( ) [inline, virtual]

Return a new Call object.

Implements LogCabin::Client::LeaderRPCBase.

Definition at line 145 of file MockClientImpl.cc.


Member Data Documentation

std::recursive_mutex LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::mutex

Prevents concurrent access to callbacks and tree.

It's recursive so that you can call the client library from within MockCallbacks, if you're that insane.

Definition at line 154 of file MockClientImpl.cc.

std::shared_ptr<TestingCallbacks> LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::callbacks

Definition at line 155 of file MockClientImpl.cc.

LogCabin::Tree::Tree LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::tree

Definition at line 156 of file MockClientImpl.cc.


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