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::DataClientProxy Class Reference

#include <DataClientProxy.hpp>

Inheritance diagram for HCE::handlers::DataClientProxy:
Collaboration diagram for HCE::handlers::DataClientProxy:

Public Member Functions

 DataClientProxy (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 ~DataClientProxy ()
- 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 handleExternalMessage (void)
void handleInternalMessage (void)
void handleRouteMessage (void)
void processControlMessage (zmsg &msg)
void processDataMessage (zmsg &msg)
std::string processAdminCommands (std::string &command, std::string &parameters)
void rebuildDataClientSocket (void)
void heartbit (void)
void sendHeartbeat (void)
void externalConnectionRefresh (void)
 Get property information.
std::string getPropertyInformation (void)
 ZMQ sockets.
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)
 Setters and getters for stat variables.
void setStatRequests (unsigned int statRequests)
unsigned int getStatRequests (void)
void setStatResponses (unsigned int statResponses)
unsigned int getStatResponses (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 logPeriodicStatistics (void)
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_inprocProxySock
zmq::socket_t_inprocReducerOutSock
zmq::socket_t_dataClientSock
bool _dataClientSockConnected = false
 Timeout shift counter.
TimeoutShiftCounter _shiftCounter
 Queue of data about connected clients use for make heartbeat message.
std::vector< ClientWorkerItem_clientsQueue
 Heartbeat at time mark.
- 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 28 of file DataClientProxy.hpp.

Constructor & Destructor Documentation

HCE::handlers::DataClientProxy::DataClientProxy ( 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 9 of file DataClientProxy.cpp.

Here is the call graph for this function:

HCE::handlers::DataClientProxy::~DataClientProxy ( )
virtual

Definition at line 19 of file DataClientProxy.cpp.

Here is the call graph for this function:

Member Function Documentation

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

Implements HCE::handlers::Handler.

Definition at line 62 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientProxy::externalConnectionRefresh ( void  )
protected

Get property information.

<Rebuild data socket

<Reset time mark

<Move heartbit time forward

<Rebuild data socket

<Move heartbit time forward

Definition at line 279 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Last time when external connectionhave received heartbit message.

Definition at line 96 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Setters and getters for stat variables.

Definition at line 104 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

ZMQ sockets.

Reimplemented from HCE::handlers::Handler.

Definition at line 320 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 112 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 120 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientProxy::handleExternalMessage ( void  )
protected

<Fetch message from dataclient

<Control message

<Data message

Reimplemented from HCE::handlers::Handler.

Definition at line 170 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientProxy::handleInternalMessage ( void  )
protected

<Fetch message from inproc_reducer_out

<Send response message to server

Reimplemented from HCE::handlers::Handler.

Definition at line 186 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientProxy::handleRouteMessage ( void  )
protected

<Fetch message from inproc_proxy

Definition at line 212 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from HCE::handlers::Handler.

Definition at line 233 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int HCE::handlers::DataClientProxy::initialize ( void  )
protectedvirtual

<Init sockets

<Node init from file

<Heartbeat at time mark

<Heartbeated time mark

<Stat vars

<Rebuild admin client socket

<Rebuild inproc_proxy connection

<Rebuild inproc_reducer_out connection

<Create dataclient socket, connect to upper node and send READY message

Implements HCE::handlers::Handler.

Definition at line 23 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void * HCE::handlers::DataClientProxy::process ( void  )
protectedvirtual

<Init polling pool

<Handle dataclient socket's message

<Send periodical property values

<Dump run-time variables at regular intervals

<Heartbited interval check and connection refresh

Implements HCE::handlers::Handler.

Definition at line 391 of file DataClientProxy.cpp.

Here is the call graph for this function:

std::string HCE::handlers::DataClientProxy::processAdminCommands ( std::string &  command,
std::string &  parameters 
)
protectedvirtual

<Process commands

<Rebuild client connection

<Disconnect client connection

<Make property information

<Parse command parameters

<Parse log priority 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 331 of file DataClientProxy.cpp.

Here is the call graph for this function:

void HCE::handlers::DataClientProxy::processControlMessage ( zmsg msg)
protected

<Register heartbit time mark

<Execute sending heartbeat

Reimplemented from HCE::handlers::Handler.

Definition at line 128 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::handlers::DataClientProxy::processDataMessage ( zmsg msg)
protected

<Proxy message to inproc handler

<Register heartbeated time mark

<Execute sending heartbeat

<Move heartbeat time forward

Reimplemented from HCE::handlers::Handler.

Definition at line 148 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 124 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

<Get resource usage data

<Build heartbeat message

<Send heartbeat message

<Reset heartbit time

Definition at line 262 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 92 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 100 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 108 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 116 of file DataClientProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<ClientWorkerItem> HCE::handlers::DataClientProxy::_clientsQueue
protected

Heartbeat at time mark.

Definition at line 65 of file DataClientProxy.hpp.

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

Definition at line 56 of file DataClientProxy.hpp.

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

Timeout shift counter.

Definition at line 57 of file DataClientProxy.hpp.

zmq::socket_t* HCE::handlers::DataClientProxy::_inprocProxySock
protected

Definition at line 54 of file DataClientProxy.hpp.

zmq::socket_t* HCE::handlers::DataClientProxy::_inprocReducerOutSock
protected

Definition at line 55 of file DataClientProxy.hpp.

TimeoutShiftCounter HCE::handlers::DataClientProxy::_shiftCounter
protected

Queue of data about connected clients use for make heartbeat message.

Definition at line 62 of file DataClientProxy.hpp.


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