hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HCE::handlers::DataClientData Class Reference

#include <DataClientData.hpp>

Inheritance diagram for HCE::handlers::DataClientData:
Collaboration diagram for HCE::handlers::DataClientData:

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 &parameters)
 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)

Detailed Description

Definition at line 32 of file DataClientData.hpp.

Constructor & Destructor Documentation

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.

Here is the call graph for this function:

HCE::handlers::DataClientData::~DataClientData ( )

Definition at line 19 of file DataClientData.cpp.

Here is the call graph for this function:

Member Function Documentation

void HCE::handlers::DataClientData::checkInit ( void  )
protected

Sockets.

<Check all stat variables

Definition at line 201 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::deinitialize ( void  )
protectedvirtual

Implements HCE::handlers::Handler.

Definition at line 57 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::externalConnectionRefresh ( void  )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char HCE::handlers::DataClientData::getDataClientSockMode ( void  )
protected

Setters and getters for stat variables.

Definition at line 77 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int64_t HCE::handlers::DataClientData::getHeartbeatAt ( void  )
protected

Last time when external connectionhave received heartbit message.

Definition at line 189 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int64_t HCE::handlers::DataClientData::getHeartbeatedAt ( void  )
protected

Definition at line 197 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string HCE::handlers::DataClientData::getPropertyInformation ( void  )
protectedvirtual

Check initialization and set default value if necessary.

Reimplemented from HCE::handlers::Handler.

Definition at line 431 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int64_t HCE::handlers::DataClientData::getPstatsAt ( void  )
protected

Time when heartbeat message for external connection need to be sent next time.

Definition at line 181 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string HCE::handlers::DataClientData::getResourceUsageMessage ( void  ) const
protected

Get property information.

<Get resource usage data

Definition at line 402 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float HCE::handlers::DataClientData::getStatQPS ( void  )
protected

Definition at line 149 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatRequests ( void  )
protected

Definition at line 85 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float HCE::handlers::DataClientData::getStatRequestsBandwidth ( void  )
protected

Definition at line 165 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatRequestsProcessed ( void  )
protected

Definition at line 117 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatRequestsProcessedSize ( void  )
protected

Definition at line 133 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatRequestsSize ( void  )
protected

Definition at line 101 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatResponses ( void  )
protected

Definition at line 93 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float HCE::handlers::DataClientData::getStatResponsesBandwidth ( void  )
protected

Send out periodical stats at regular intervals.

Definition at line 173 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatResponsesProcessed ( void  )
protected

Definition at line 125 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatResponsesProcessedSize ( void  )
protected

Definition at line 141 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int HCE::handlers::DataClientData::getStatResponsesSize ( void  )
protected

Definition at line 109 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float HCE::handlers::DataClientData::getStatRPS ( void  )
protected

Definition at line 157 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::handleExternalMessage ( void  )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::handleInternalMessage ( void  )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::heartbit ( void  )
protected

<Execute sending heartbeat

<Execute sending heartbeat

<Reset shift counter

Reimplemented from HCE::handlers::Handler.

Definition at line 352 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int HCE::handlers::DataClientData::initialize ( void  )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::logPeriodicStatistics ( void  )
protected

<Reset pstat time

Reimplemented from HCE::handlers::Handler.

Definition at line 410 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void * HCE::handlers::DataClientData::process ( void  )
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.

Here is the call graph for this function:

std::string HCE::handlers::DataClientData::processAdminCommands ( std::string &  command,
std::string &  parameters 
)
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.

Here is the call graph for this function:

void HCE::handlers::DataClientData::rebuildDataClientSocket ( void  )
protected

Definition at line 240 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::sendHeartbeat ( void  )
protected

<Send heartbeat with resource usage message

<Reset heartbit time

Definition at line 385 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setDataClientSockMode ( unsigned char  dataClientSockMode)
protected

Definition at line 73 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setHeartbeatAt ( int64_t  heartbeatAt)
protected

Definition at line 185 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setHeartbeatedAt ( int64_t  heartbeatedAt)
protected

Definition at line 193 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setPstatsAt ( int64_t  pstatsAt)
protected

Definition at line 177 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatQPS ( float  statQPS)
protected

Definition at line 145 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRequests ( unsigned int  statRequests)
protected

Definition at line 81 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRequestsBandwidth ( float  statRequestsBandwidth)
protected

Definition at line 161 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRequestsProcessed ( unsigned int  statRequestsProcessed)
protected

Definition at line 113 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRequestsProcessedSize ( unsigned int  statRequestsProcessedSize)
protected

Definition at line 129 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRequestsSize ( unsigned int  statRequestsSize)
protected

Definition at line 97 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatResponses ( unsigned int  statResponses)
protected

Definition at line 89 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatResponsesBandwidth ( float  statResponsesBandwidth)
protected

Definition at line 169 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatResponsesProcessed ( unsigned int  statResponsesProcessed)
protected

Definition at line 121 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatResponsesProcessedSize ( unsigned int  statResponsesProcessedSize)
protected

Definition at line 137 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatResponsesSize ( unsigned int  statResponsesSize)
protected

Definition at line 105 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientData::setStatRPS ( float  statRPS)
protected

Definition at line 153 of file DataClientData.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

zmq::socket_t* HCE::handlers::DataClientData::_dataClientSock
protected

Definition at line 65 of file DataClientData.hpp.

bool HCE::handlers::DataClientData::_dataClientSockConnected = false
protected

Timeout shift counter.

Definition at line 66 of file DataClientData.hpp.

zmq::socket_t* HCE::handlers::DataClientData::_inprocDataSock
protected

Definition at line 64 of file DataClientData.hpp.

TimeoutShiftCounter HCE::handlers::DataClientData::_shiftCounter
protected

Data client mode.

Definition at line 71 of file DataClientData.hpp.


The documentation for this class was generated from the following files: