LogCabin
|
#include <RaftService.h>
Public Member Functions | |
RaftService (Globals &globals) | |
Constructor. | |
~RaftService () | |
Destructor. | |
void | handleRPC (RPC::ServerRPC rpc) |
This method is overridden by a subclass and invoked by the Server class when a new RPC arrives. | |
std::string | getName () const |
Return a short name for this service which can be used in things like log messages. | |
RaftService (const RaftService &) | |
RaftService & | operator= (const RaftService &) |
Private Member Functions | |
void | requestVote (RPC::ServerRPC rpc) |
void | appendEntries (RPC::ServerRPC rpc) |
void | installSnapshot (RPC::ServerRPC rpc) |
Private Attributes | |
Globals & | globals |
The LogCabin daemon's top-level objects. |
Definition at line 28 of file RaftService.h.
LogCabin::Server::RaftService::RaftService | ( | Globals & | globals | ) | [explicit] |
Constructor.
Definition at line 27 of file RaftService.cc.
Destructor.
Definition at line 32 of file RaftService.cc.
void LogCabin::Server::RaftService::handleRPC | ( | RPC::ServerRPC | serverRPC | ) | [virtual] |
This method is overridden by a subclass and invoked by the Server class when a new RPC arrives.
It should call ServerRPC::reply() or another method on the RPC to handle the request. The Server class calls this on a thread pool.
Implements LogCabin::RPC::Service.
Definition at line 37 of file RaftService.cc.
std::string LogCabin::Server::RaftService::getName | ( | ) | const [virtual] |
Return a short name for this service which can be used in things like log messages.
Implements LogCabin::RPC::Service.
Definition at line 60 of file RaftService.cc.
void LogCabin::Server::RaftService::requestVote | ( | RPC::ServerRPC | rpc | ) | [private] |
Definition at line 99 of file RaftService.cc.
void LogCabin::Server::RaftService::appendEntries | ( | RPC::ServerRPC | rpc | ) | [private] |
Definition at line 79 of file RaftService.cc.
void LogCabin::Server::RaftService::installSnapshot | ( | RPC::ServerRPC | rpc | ) | [private] |
Definition at line 89 of file RaftService.cc.
RaftService& LogCabin::Server::RaftService::operator= | ( | const RaftService & | ) |
Globals& LogCabin::Server::RaftService::globals [private] |
The LogCabin daemon's top-level objects.
Definition at line 50 of file RaftService.h.