LogCabin
|
This class intercepts LeaderRPC calls from ClientImpl. More...
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< TestingCallbacks > | callbacks |
LogCabin::Tree::Tree | tree |
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.
LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::TreeLeaderRPC | ( | std::shared_ptr< TestingCallbacks > | callbacks | ) | [inline, explicit] |
Definition at line 54 of file MockClientImpl.cc.
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.
opCode | RPC operation code. The caller must guarantee that this is a valid opCode. (If the server rejects it, this will PANIC.) | |
request | The parameters for the operation. The caller must guarantee that this is a well-formed request. (If the server rejects it, this will PANIC.) | |
timeout | After this time has elapsed, stop waiting and return TIMEOUT. In this case, response will be left unmodified. | |
[out] | response | The 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.
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.