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

List of all members.

Public Member Functions

 Call (TreeLeaderRPC &leaderRPC)
void start (OpCode _opCode, const google::protobuf::Message &_request, TimePoint _timeout)
 Invoke the RPC.
void cancel ()
 Cancel the RPC.
Status wait (google::protobuf::Message &response, TimePoint timeout)
 Wait for the RPC to complete.
 Call (const Call &)
Calloperator= (const Call &)

Public Attributes

TreeLeaderRPCleaderRPC
OpCode opCode
std::unique_ptr
< google::protobuf::Message > 
request

Detailed Description

Definition at line 113 of file MockClientImpl.cc.


Constructor & Destructor Documentation

LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::Call ( TreeLeaderRPC leaderRPC) [inline, explicit]

Definition at line 115 of file MockClientImpl.cc.

LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::Call ( const Call )

Member Function Documentation

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

Invoke the RPC.

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 trying to initiate the connection to the leader and use an invalid session, which will cause the RPC to fail later.

Implements LogCabin::Client::LeaderRPCBase::Call.

Definition at line 121 of file MockClientImpl.cc.

void LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::cancel ( ) [inline, virtual]

Cancel the RPC.

This may only be called after start(), but it may be called safely from a separate thread.

Implements LogCabin::Client::LeaderRPCBase::Call.

Definition at line 128 of file MockClientImpl.cc.

Status LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::wait ( google::protobuf::Message &  response,
TimePoint  timeout 
) [inline, virtual]

Wait for the RPC to complete.

Parameters:
[out]responseIf successful, the response to the operation will be filled in here.
timeoutAfter this time has elapsed, stop waiting and return TIMEOUT. In this case, response will be left unmodified.
Returns:
True if the RPC completed successfully, false otherwise. If this returns false, it is the callers responsibility to start over to achieve the same at-most-once semantics as call().

Implements LogCabin::Client::LeaderRPCBase::Call.

Definition at line 131 of file MockClientImpl.cc.

Call& LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::operator= ( const Call )

Member Data Documentation

TreeLeaderRPC& LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::leaderRPC

Definition at line 136 of file MockClientImpl.cc.

OpCode LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::opCode

Definition at line 137 of file MockClientImpl.cc.

std::unique_ptr<google::protobuf::Message> LogCabin::Client::anonymous_namespace{MockClientImpl.cc}::TreeLeaderRPC::Call::request

Definition at line 138 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