hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
|
#include <DataClientData.hpp>
Public Member Functions | |
DataClientData (std::string name, zmq::context_t &ctx, const std::string &clientIdentity, std::string connectionString, unsigned char dataClientMode, int64_t startedAt, unsigned char logPriority, const std::string &iniFile="") | |
~DataClientData () | |
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 | rebuildDataClientSocket (void) |
void | handleExternalMessage (void) |
void | handleInternalMessage (void) |
void | heartbit (void) |
void | sendHeartbeat (void) |
void | logPeriodicStatistics (void) |
void | externalConnectionRefresh (void) |
std::string | processAdminCommands (std::string &command, std::string ¶meters) |
Get resource usage message. | |
std::string | getResourceUsageMessage (void) const |
Get property information. | |
std::string | getPropertyInformation (void) |
Check initialization and set default value if necessary. | |
void | checkInit (void) |
Sockets. | |
void | setDataClientSockMode (unsigned char dataClientSockMode) |
unsigned char | getDataClientSockMode (void) |
Setters and getters for stat variables. | |
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) |
Time when heartbeat message for external connection need to be sent next time. | |
void | setHeartbeatAt (int64_t heartbeatAt) |
int64_t | getHeartbeatAt (void) |
Last time when external connectionhave received heartbit message. | |
void | setHeartbeatedAt (int64_t heartbeatedAt) |
int64_t | getHeartbeatedAt (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 | registerClient (const std::string &identity) |
Admin socket. | |
Protected Member Functions inherited from HCE::handlers::DataNodeOptions | |
DataNodeOptions (HandlerProperties &handlerProperties) | |
virtual | ~DataNodeOptions (void) |
void | initNode (const std::string &iniFile, LoggerStream &logger) |
void | setHeartbeatDelay (unsigned int heartbeatDelay) |
unsigned int | getHeartbeatDelay (void) |
void | setHeartbeatTimeout (unsigned int heartbeatTimeout) |
unsigned int | getHeartbeatTimeout (void) |
void | setHeartbeatMode (unsigned int heartbeatMode) |
unsigned int | getHeartbeatMode (void) |
Protected Attributes | |
zmq::socket_t * | _inprocDataSock |
zmq::socket_t * | _dataClientSock |
bool | _dataClientSockConnected = false |
Timeout shift counter. | |
TimeoutShiftCounter | _shiftCounter |
Data client mode. | |
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 32 of file DataClientData.hpp.
HCE::handlers::DataClientData::DataClientData | ( | std::string | name, |
zmq::context_t & | ctx, | ||
const std::string & | clientIdentity, | ||
std::string | connectionString, | ||
unsigned char | dataClientMode, | ||
int64_t | startedAt, | ||
unsigned char | logPriority, | ||
const std::string & | iniFile = "" |
||
) |
<Init all the rest
Definition at line 8 of file DataClientData.cpp.
HCE::handlers::DataClientData::~DataClientData | ( | ) |
|
protected |
Sockets.
<Check all stat variables
Definition at line 201 of file DataClientData.cpp.
|
protectedvirtual |
Implements HCE::handlers::Handler.
Definition at line 57 of file DataClientData.cpp.
|
protected |
<Rebuild data socket
<Reset time mark
<Move heartbit time forward
<Rebuild data socket
<Reset time mark
<Move heartbit time forward
Definition at line 450 of file DataClientData.cpp.
|
protected |
Setters and getters for stat variables.
Definition at line 77 of file DataClientData.cpp.
|
protected |
Last time when external connectionhave received heartbit message.
Definition at line 189 of file DataClientData.cpp.
|
protected |
Definition at line 197 of file DataClientData.cpp.
|
protectedvirtual |
Check initialization and set default value if necessary.
Reimplemented from HCE::handlers::Handler.
Definition at line 431 of file DataClientData.cpp.
|
protected |
Time when heartbeat message for external connection need to be sent next time.
Definition at line 181 of file DataClientData.cpp.
|
protected |
Get property information.
<Get resource usage data
Definition at line 402 of file DataClientData.cpp.
|
protected |
Definition at line 149 of file DataClientData.cpp.
|
protected |
Definition at line 85 of file DataClientData.cpp.
|
protected |
Definition at line 165 of file DataClientData.cpp.
|
protected |
Definition at line 117 of file DataClientData.cpp.
|
protected |
Definition at line 133 of file DataClientData.cpp.
|
protected |
Definition at line 101 of file DataClientData.cpp.
|
protected |
Definition at line 93 of file DataClientData.cpp.
|
protected |
Send out periodical stats at regular intervals.
Definition at line 173 of file DataClientData.cpp.
|
protected |
Definition at line 125 of file DataClientData.cpp.
|
protected |
Definition at line 141 of file DataClientData.cpp.
|
protected |
Definition at line 109 of file DataClientData.cpp.
|
protected |
Definition at line 157 of file DataClientData.cpp.
|
protected |
<Fetch message from dataclient
<Process message
<Control message
<Register heartbit time mark
<Execute sending heartbeat
<Data message
<Create identity of dataclient's message
<Create response message and set message Id
<Set message body
<Set message route
<Send response for dataclient from end-point node
<Send response for data handler of end-point node
<Reset timestamp for shift counter
<Move heartbeat time forward
Reimplemented from HCE::handlers::Handler.
Definition at line 249 of file DataClientData.cpp.
|
protected |
<Get message from inproc_data
<Re-send response message directly, not using the responses map
<Move heartbit time forward
Reimplemented from HCE::handlers::Handler.
Definition at line 333 of file DataClientData.cpp.
|
protected |
<Execute sending heartbeat
<Execute sending heartbeat
<Reset shift counter
Reimplemented from HCE::handlers::Handler.
Definition at line 352 of file DataClientData.cpp.
|
protectedvirtual |
<Init sockets
<Node init from file
<Heartbeat at time mark
<Heartbeated time mark
<Send out periodical stats at regular intervals
<Check initialization and set default value if necessary
<Rebuild admin client socket
<Rebuild inproc_proxy connection
<Create dataclient socket, connect to upper node and send READY message
Implements HCE::handlers::Handler.
Definition at line 23 of file DataClientData.cpp.
|
protected |
<Reset pstat time
Reimplemented from HCE::handlers::Handler.
Definition at line 410 of file DataClientData.cpp.
|
protectedvirtual |
<Init polling pool
<Handle dataclient socket's message
<Out periodical stats
<Send periodical property values
<Dump run-time variables at regular intervals
<Heartbited interval check and connection refresh
Implements HCE::handlers::Handler.
Definition at line 553 of file DataClientData.cpp.
|
protectedvirtual |
Get resource usage message.
<Process commands
<Rebuild client connection
<Disconnect client connection
<Make property information
<Parse command parameters
<Parse heartbeat delay from parameters
<Set new heartbeat delay value
<Parse command parameters
<Parse heartbeat timeout from parameters
<Set new heartbeat timeout value
<Parse command parameters
<Parse heartbeat mode from parameters
<Set new heartbeat mode value
<Unsupported command
Reimplemented from HCE::handlers::Handler.
Definition at line 492 of file DataClientData.cpp.
|
protected |
Definition at line 240 of file DataClientData.cpp.
|
protected |
<Send heartbeat with resource usage message
<Reset heartbit time
Definition at line 385 of file DataClientData.cpp.
|
protected |
Definition at line 73 of file DataClientData.cpp.
|
protected |
Definition at line 185 of file DataClientData.cpp.
|
protected |
Definition at line 193 of file DataClientData.cpp.
|
protected |
Definition at line 177 of file DataClientData.cpp.
|
protected |
Definition at line 145 of file DataClientData.cpp.
|
protected |
Definition at line 81 of file DataClientData.cpp.
|
protected |
Definition at line 161 of file DataClientData.cpp.
|
protected |
Definition at line 113 of file DataClientData.cpp.
|
protected |
Definition at line 129 of file DataClientData.cpp.
|
protected |
Definition at line 97 of file DataClientData.cpp.
|
protected |
Definition at line 89 of file DataClientData.cpp.
|
protected |
Definition at line 169 of file DataClientData.cpp.
|
protected |
Definition at line 121 of file DataClientData.cpp.
|
protected |
Definition at line 137 of file DataClientData.cpp.
|
protected |
Definition at line 105 of file DataClientData.cpp.
|
protected |
Definition at line 153 of file DataClientData.cpp.
|
protected |
Definition at line 65 of file DataClientData.hpp.
|
protected |
Timeout shift counter.
Definition at line 66 of file DataClientData.hpp.
|
protected |
Definition at line 64 of file DataClientData.hpp.
|
protected |
Data client mode.
Definition at line 71 of file DataClientData.hpp.