CernVM-FS
2.12.0
|
#include <reactor.h>
Public Types | |
enum | Request { kQuit = 0, kEcho, kGenerateToken, kGetTokenId, kCheckToken, kSubmitPayload, kCommit, kError, kTestCrash } |
Public Member Functions | |
Reactor (int fdin, int fdout) | |
virtual | ~Reactor () |
bool | Run () |
Static Public Member Functions | |
static Request | ReadRequest (int fd, std::string *data) |
static bool | WriteRequest (int fd, Request req, const std::string &data) |
static bool | ReadReply (int fd, std::string *data) |
static bool | WriteReply (int fd, const std::string &data) |
static bool | ExtractStatsFromReq (JsonDocument *req, perf::Statistics *stats, std::string *start_time) |
Protected Member Functions | |
virtual bool | HandleGenerateToken (const std::string &req, std::string *reply) |
virtual bool | HandleGetTokenId (const std::string &req, std::string *reply) |
virtual bool | HandleCheckToken (const std::string &req, std::string *reply) |
virtual bool | HandleSubmitPayload (int fdin, const std::string &req, std::string *reply) |
virtual bool | HandleCommit (const std::string &req, std::string *reply) |
virtual PayloadProcessor * | MakePayloadProcessor () |
virtual CommitProcessor * | MakeCommitProcessor () |
Private Member Functions | |
bool | HandleRequest (Request req, const std::string &data) |
Private Attributes | |
int | fdin_ |
int | fdout_ |
std::map< std::string, perf::Statistics * > | statistics_map_ |
This is the main event loop of the cvmfs_receiver
program.
It implements a synchronous protocol, reading JSON requests from the fdin_ file descriptor and writing JSON responses to fdout_. It handles the framing of the protocol and the dispatching of the different types of events to specific handler methods.
receiver::Reactor::Reactor | ( | int | fdin, |
int | fdout | ||
) |
Definition at line 176 of file reactor.cc.
|
virtual |
Definition at line 178 of file reactor.cc.
|
static |
Definition at line 122 of file reactor.cc.
Referenced by HandleCommit().
|
protectedvirtual |
Definition at line 262 of file reactor.cc.
Referenced by HandleRequest().
|
protectedvirtual |
Definition at line 389 of file reactor.cc.
Referenced by HandleRequest().
|
protectedvirtual |
Definition at line 196 of file reactor.cc.
Referenced by HandleRequest().
|
protectedvirtual |
Definition at line 242 of file reactor.cc.
Referenced by HandleRequest().
|
private |
Definition at line 480 of file reactor.cc.
Referenced by Run().
|
protectedvirtual |
Definition at line 319 of file reactor.cc.
Referenced by HandleRequest().
|
protectedvirtual |
Definition at line 476 of file reactor.cc.
Referenced by HandleCommit().
|
protectedvirtual |
Definition at line 472 of file reactor.cc.
Referenced by HandleSubmitPayload().
|
static |
|
static |
Definition at line 37 of file reactor.cc.
Referenced by Run().
bool receiver::Reactor::Run | ( | ) |
Definition at line 180 of file reactor.cc.
Referenced by main().
|
static |
Definition at line 107 of file reactor.cc.
Referenced by HandleRequest().
|
static |
|
private |
Definition at line 73 of file reactor.h.
Referenced by HandleRequest(), and Run().
|
private |
Definition at line 74 of file reactor.h.
Referenced by HandleRequest().
|
private |