hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
|
#include <RouterServerProxy.hpp>
Public Member Functions | |
RouterServerProxy (std::string name, zmq::context_t &ctx, const std::string &clientIdentity, std::string connectionString, int64_t startedAt, unsigned char logPriority, const std::string &iniFile) | |
virtual | ~RouterServerProxy () |
Public Member Functions inherited from HCE::handlers::Handler | |
Handler (const std::string &name, zmq::context_t &context, const std::string &clientIdentity, const std::string &connectionString, int64_t startedAt, unsigned char logPriority, const std::string &iniFile="") | |
virtual | ~Handler () |
void | shutdown (void) |
Get handler instance name. | |
std::string | getName (void) |
Protected Member Functions | |
int | initialize (void) |
void | deinitialize (void) |
void * | process (void) |
void | handleInternalMessage (void) |
void | handleExternalMessage (void) |
void | handleRouteMessage (void) |
std::string | processAdminCommands (std::string &command, std::string ¶meters) |
void | logPeriodicStatistics (void) |
Get property information. | |
std::string | getPropertyInformation (void) |
Check initialization and set default value if necessary. | |
void | checkInit (void) |
ZMQ Sockets. | |
void | setStatRequests (unsigned int statRequests) |
unsigned int | getStatRequests (void) |
void | setStatResponses (unsigned int statResponses) |
unsigned int | getStatResponses (void) |
void | setStatRequestsSize (unsigned int statRequestsSize) |
unsigned int | getStatRequestsSize (void) |
void | setStatResponsesSize (unsigned int statResponsesSize) |
unsigned int | getStatResponsesSize (void) |
void | setStatRequestsProcessed (unsigned int statRequestsProcessed) |
unsigned int | getStatRequestsProcessed (void) |
void | setStatResponsesProcessed (unsigned int statResponsesProcessed) |
unsigned int | getStatResponsesProcessed (void) |
void | setStatRequestsProcessedSize (unsigned int statRequestsProcessedSize) |
unsigned int | getStatRequestsProcessedSize (void) |
void | setStatResponsesProcessedSize (unsigned int statResponsesProcessedSize) |
unsigned int | getStatResponsesProcessedSize (void) |
void | setStatQPS (float statQPS) |
float | getStatQPS (void) |
void | setStatRPS (float statRPS) |
float | getStatRPS (void) |
void | setStatRequestsBandwidth (float statRequestsBandwidth) |
float | getStatRequestsBandwidth (void) |
void | setStatResponsesBandwidth (float statResponsesBandwidth) |
float | getStatResponsesBandwidth (void) |
Send out periodical stats at regular intervals. | |
void | setPstatsAt (int64_t pstatsAt) |
int64_t | getPstatsAt (void) |
Protected Member Functions inherited from HCE::handlers::Handler | |
void | setName (const std::string &name) |
<Set handler instance name | |
void | setClientIdentity (const std::string &clientIdentity) |
Get client ID. | |
std::string | getClientIdentity (void) |
Set start time mark. | |
void | setStartedAt (int64_t startedAt) |
Get start time mark. | |
int64_t | getStartedAt (void) |
Set log priority level. | |
void | setLogPriority (unsigned int logPriority) |
Get log priority level. | |
unsigned int | getLogPriority (void) |
Set ini file name. | |
void | setIniFile (const std::string &iniFile) |
Get ini file name. | |
std::string | getIniFile (void) |
Set ZMQ connections rebuild tries max number. | |
void | setBindTriesMaxNumber (const unsigned int &bindTriesMaxNumber) |
Get ZMQ connections rebuild tries max number. | |
unsigned int | getBindTriesMaxNumber (void) |
Set ZMQ connections rebuild tries delay. | |
void | setBindTriesDelay (const unsigned int &bindTriesDelay) |
Get ZMQ connections rebuild tries delay. | |
unsigned int | getBindTriesDelay (void) |
Set ZMQ connection string. | |
void | setConnectionString (const std::string &connectionString) |
Get ZMQ connection string. | |
std::string | getConnectionString (void) |
Set flag for polling condition. | |
void | setInProgress (bool in_progress) |
Get flag for polling condition. | |
bool | getInProgress (void) const |
Set poll timeout value. | |
void | setPollTimeout (unsigned int pollTimeout) |
Get poll timeout value. | |
unsigned int | getPollTimeout (void) |
Set property interval between resend Property values. | |
void | setPropertyInterval (unsigned int propertyInterval) |
Get property interval between resend Property values. | |
unsigned int | getPropertyInterval (void) |
Set interval between dump run-time variables. | |
void | setDumpInterval (unsigned int dumpInterval) |
Get interval between dump run-time variables. | |
unsigned int | getDumpInterval (void) |
Set flag for allowed restore variables use dump. | |
void | setDumpAllowRestore (unsigned int dumpAllowRestore) |
Get interval between dump run-time variables. | |
unsigned int | getDumpAllowRestore (void) |
void | logFlush (unsigned int priority=NODE_LOG_MODE_DEFAULT) |
Node init from file. | |
void | initHandler (const std::string &iniFile, LoggerStream &logger) |
void | handleAdminMessage (void) |
void | processAdminMessage (zmsg &msg) |
void | rebuildAdminClientSocket (void) |
bool | rebuildServerConnection (zmq::socket_t *&sock_p, const std::string &connectionString, const int type) |
void | rebuildClientConnection (zmq::socket_t *&sock_p, const std::string &connectionString, const int type, const std::string &identity="") |
bool | rebuildClientConnection (zmq::socket_t *&sock_p, const std::string &connectionString, const int type, const std::string &identity, int linger, const std::string &readyMessage="", const std::string &byeMessage=NODE_MSG_BYE) |
void | sendByeMessage (zmq::socket_t *&sock_p, const std::string &identity="", const std::string &byeMessage=NODE_MSG_BYE) |
std::string | getProperties (void) |
Get property information. | |
void | sendPeriodicProperties (void) |
Safe create directories if necessary. | |
void | createDirectories (const std::string &name) |
Get file name use for dump and restore properties values. | |
std::string | getDumpFileName (void) |
Get file name use for dump and restore statistic values. | |
std::string | getStatFileName (void) |
Dump properties variables. | |
bool | dumpProperties (void) |
Dump run-time variables at regular intervals. | |
bool | dumpRunTimeVariables (void) |
void | processControlMessage (zmsg &msg) |
void | processDataMessage (zmsg &msg) |
void | heartbit (void) |
void | registerClient (const std::string &identity) |
Admin socket. |
Protected Attributes | |
zmq::socket_t * | _inprocProxySock |
zmq::socket_t * | _inprocReducerOutSock |
zmq::socket_t * | _routerServerSock |
Messages data accumulator map. | |
std::map< std::string, DefaultReducerResponseItem * > | _responses |
Setters and getters for stat variables. | |
Protected Attributes inherited from HCE::handlers::Handler | |
zmq::socket_t * | _inprocAdminSock |
Storage for run-time property variables. | |
HandlerProperties | handlerProperties |
Storage for run-time statistic variables. | |
HandlerProperties | statProperties |
ZMQ context. | |
zmq::context_t & | _context |
std::bitset< 4 > | _logMask |
std::string | _logTimeFormat |
std::stringstream | log |
LoggerStream | logger |
Main loop of sockets polling condition. | |
bool | _inProgress |
Send out periodical property values to Admin class at regular intervals. | |
int64_t | _propertyIntervalAt |
Dump run-time variables at regular intervals. | |
int64_t | _dumpIntervalAt |
Dump dir name. | |
std::string | _dumpDir |
Additional Inherited Members | |
Static Public Member Functions inherited from HCE::handlers::Handler | |
static void * | main (void *that) |
Definition at line 30 of file RouterServerProxy.hpp.
HCE::handlers::RouterServerProxy::RouterServerProxy | ( | std::string | name, |
zmq::context_t & | ctx, | ||
const std::string & | clientIdentity, | ||
std::string | connectionString, | ||
int64_t | startedAt, | ||
unsigned char | logPriority, | ||
const std::string & | iniFile | ||
) |
<Init all the rest
Definition at line 7 of file RouterServerProxy.cpp.
|
virtual |
|
protected |
ZMQ Sockets.
<Check all stat variables
Definition at line 166 of file RouterServerProxy.cpp.
|
protectedvirtual |
Implements HCE::handlers::Handler.
Definition at line 46 of file RouterServerProxy.cpp.
|
protectedvirtual |
Check initialization and set default value if necessary.
Reimplemented from HCE::handlers::Handler.
Definition at line 377 of file RouterServerProxy.cpp.
|
protected |
Definition at line 162 of file RouterServerProxy.cpp.
|
protected |
Definition at line 130 of file RouterServerProxy.cpp.
|
protected |
Definition at line 66 of file RouterServerProxy.cpp.
|
protected |
Definition at line 146 of file RouterServerProxy.cpp.
|
protected |
Definition at line 98 of file RouterServerProxy.cpp.
|
protected |
Definition at line 114 of file RouterServerProxy.cpp.
|
protected |
Definition at line 82 of file RouterServerProxy.cpp.
|
protected |
Definition at line 74 of file RouterServerProxy.cpp.
|
protected |
Send out periodical stats at regular intervals.
Definition at line 154 of file RouterServerProxy.cpp.
|
protected |
Definition at line 106 of file RouterServerProxy.cpp.
|
protected |
Definition at line 122 of file RouterServerProxy.cpp.
|
protected |
Definition at line 90 of file RouterServerProxy.cpp.
|
protected |
Definition at line 138 of file RouterServerProxy.cpp.
|
protected |
<Fetch message from dataclient
<Data message
<Parse message, create identity, messageId and body of dataclient's message
<Generate unique request Id from client_Id amd message_Id and rebuild message for farther processing
Reimplemented from HCE::handlers::Handler.
Definition at line 247 of file RouterServerProxy.cpp.
|
protected |
<Fetch message from inproc_reducer_out
<Parse message, create identity, messageId and body of dataclient's message
<Generate unique client_Id and request Id from message_Id and rebuild message to send response to the client via ZMQ router
<Split message_Id on two parts
<Fill message with router`s client_Id, message_Id and messageBody
<Send response message to client router`s client
<Wrong message_Id format
Reimplemented from HCE::handlers::Handler.
Definition at line 205 of file RouterServerProxy.cpp.
|
protected |
<Fetch message from inproc_proxy
Definition at line 294 of file RouterServerProxy.cpp.
|
protectedvirtual |
<Init sockets
<Check initialization and set default value if necessary
<Send out periodical stats at regular intervals
<Rebuild admin client socket
<Rebuild inproc_proxy connection
<Rebuild inproc_reducer_out connection
<Rebuild external server connection
Implements HCE::handlers::Handler.
Definition at line 19 of file RouterServerProxy.cpp.
|
protected |
Get property information.
Reimplemented from HCE::handlers::Handler.
Definition at line 356 of file RouterServerProxy.cpp.
|
protectedvirtual |
<Init polling pool sockets array
<Handle routerserver's socket message if connected
<Send periodical property values
<Dump run-time variables at regular intervals
Implements HCE::handlers::Handler.
Definition at line 389 of file RouterServerProxy.cpp.
|
protectedvirtual |
<Process commands
<Rebuild server connection
<Disconnect server connection
<Make property information
<Unsupported command
Reimplemented from HCE::handlers::Handler.
Definition at line 326 of file RouterServerProxy.cpp.
|
protected |
Definition at line 158 of file RouterServerProxy.cpp.
|
protected |
Definition at line 126 of file RouterServerProxy.cpp.
|
protected |
Definition at line 62 of file RouterServerProxy.cpp.
|
protected |
Definition at line 142 of file RouterServerProxy.cpp.
|
protected |
Definition at line 94 of file RouterServerProxy.cpp.
|
protected |
Definition at line 110 of file RouterServerProxy.cpp.
|
protected |
Definition at line 78 of file RouterServerProxy.cpp.
|
protected |
Definition at line 70 of file RouterServerProxy.cpp.
|
protected |
Definition at line 150 of file RouterServerProxy.cpp.
|
protected |
Definition at line 102 of file RouterServerProxy.cpp.
|
protected |
Definition at line 118 of file RouterServerProxy.cpp.
|
protected |
Definition at line 86 of file RouterServerProxy.cpp.
|
protected |
Definition at line 134 of file RouterServerProxy.cpp.
|
protected |
Definition at line 57 of file RouterServerProxy.hpp.
|
protected |
Definition at line 58 of file RouterServerProxy.hpp.
|
protected |
Setters and getters for stat variables.
Definition at line 64 of file RouterServerProxy.hpp.
|
protected |
Messages data accumulator map.
Definition at line 61 of file RouterServerProxy.hpp.