#include <DQMNet.h>
Classes | |
struct | AutoPeer |
struct | Bucket |
struct | CoreObject |
struct | HashEqual |
struct | HashOp |
struct | Object |
struct | Peer |
struct | QValue |
struct | WaitObject |
Public Types | |
typedef std::vector< unsigned char > | DataBlob |
typedef std::vector< QValue > | QReports |
typedef std::vector< uint32_t > | TagList |
typedef std::list< WaitObject > | WaitList |
Public Member Functions | |
void | debug (bool doit) |
void | delay (int delay) |
DQMNet (const std::string &appname="") | |
void | listenToCollector (const std::string &host, int port) |
void | lock (void) |
Acquire a lock on the DQM net layer. More... | |
void | run (void) |
void | sendLocalChanges (void) |
void | shutdown (void) |
Stop the network layer and wait it to finish. More... | |
void | staleObjectWaitLimit (lat::TimeSpan time) |
void | start (void) |
void | startLocalServer (int port) |
void | startLocalServer (const char *path) |
void | unlock (void) |
Release the lock on the DQM net layer. More... | |
void | updateToCollector (const std::string &host, int port) |
virtual | ~DQMNet (void) |
Static Public Member Functions | |
static size_t | dqmhash (const void *key, size_t keylen) |
static void | packQualityData (std::string &into, const QReports &qr) |
static bool | setOrder (const CoreObject &a, const CoreObject &b) |
static void | unpackQualityData (QReports &qr, uint32_t &flags, const char *from) |
Static Public Attributes | |
static const uint32_t | DQM_MSG_GET_OBJECT = 3 |
static const uint32_t | DQM_MSG_HELLO = 0 |
static const uint32_t | DQM_MSG_LIST_OBJECTS = 2 |
static const uint32_t | DQM_MSG_UPDATE_ME = 1 |
static const uint32_t | DQM_PROP_ACCUMULATE = 0x00004000 |
static const uint32_t | DQM_PROP_DEAD = 0x00080000 |
static const uint32_t | DQM_PROP_EFFICIENCY_PLOT = 0x00200000 |
static const uint32_t | DQM_PROP_HAS_REFERENCE = 0x00001000 |
static const uint32_t | DQM_PROP_LUMI = 0x00040000 |
static const uint32_t | DQM_PROP_MARKTODELETE = 0x01000000 |
static const uint32_t | DQM_PROP_NEW = 0x00010000 |
static const uint32_t | DQM_PROP_RECEIVED = 0x00020000 |
static const uint32_t | DQM_PROP_REPORT_ALARM |
static const uint32_t | DQM_PROP_REPORT_CLEAR = 0x00000000 |
static const uint32_t | DQM_PROP_REPORT_ERROR = 0x00000100 |
static const uint32_t | DQM_PROP_REPORT_MASK = 0x00000f00 |
static const uint32_t | DQM_PROP_REPORT_OTHER = 0x00000400 |
static const uint32_t | DQM_PROP_REPORT_WARN = 0x00000200 |
static const uint32_t | DQM_PROP_RESET = 0x00008000 |
static const uint32_t | DQM_PROP_STALE = 0x00100000 |
static const uint32_t | DQM_PROP_TAGGED = 0x00002000 |
static const uint32_t | DQM_PROP_TYPE_DATABLOB = 0x00000050 |
static const uint32_t | DQM_PROP_TYPE_INT = 0x00000001 |
static const uint32_t | DQM_PROP_TYPE_INVALID = 0x00000000 |
static const uint32_t | DQM_PROP_TYPE_MASK = 0x000000ff |
static const uint32_t | DQM_PROP_TYPE_REAL = 0x00000002 |
static const uint32_t | DQM_PROP_TYPE_SCALAR = 0x0000000f |
static const uint32_t | DQM_PROP_TYPE_STRING = 0x00000003 |
static const uint32_t | DQM_PROP_TYPE_TH1D = 0x00000012 |
static const uint32_t | DQM_PROP_TYPE_TH1F = 0x00000010 |
static const uint32_t | DQM_PROP_TYPE_TH1S = 0x00000011 |
static const uint32_t | DQM_PROP_TYPE_TH2D = 0x00000022 |
static const uint32_t | DQM_PROP_TYPE_TH2F = 0x00000020 |
static const uint32_t | DQM_PROP_TYPE_TH2S = 0x00000021 |
static const uint32_t | DQM_PROP_TYPE_TH3D = 0x00000032 |
static const uint32_t | DQM_PROP_TYPE_TH3F = 0x00000030 |
static const uint32_t | DQM_PROP_TYPE_TH3S = 0x00000031 |
static const uint32_t | DQM_PROP_TYPE_TPROF = 0x00000040 |
static const uint32_t | DQM_PROP_TYPE_TPROF2D = 0x00000041 |
static const uint32_t | DQM_REPLY_LIST_BEGIN = 101 |
static const uint32_t | DQM_REPLY_LIST_END = 102 |
static const uint32_t | DQM_REPLY_NONE = 103 |
static const uint32_t | DQM_REPLY_OBJECT = 104 |
static const uint32_t | MAX_PEER_WAITREQS = 128 |
Protected Member Functions | |
virtual Peer * | createPeer (lat::Socket *s)=0 |
virtual Object * | findObject (Peer *p, const std::string &name, Peer **owner=0)=0 |
virtual Peer * | getPeer (lat::Socket *s)=0 |
std::ostream & | logme (void) |
virtual Object * | makeObject (Peer *p, const std::string &name)=0 |
virtual void | markObjectsDead (Peer *p)=0 |
virtual bool | onMessage (Bucket *msg, Peer *p, unsigned char *data, size_t len) |
virtual void | purgeDeadObjects (Peer *p)=0 |
virtual void | releaseFromWait (Bucket *msg, WaitObject &w, Object *o) |
virtual void | removePeer (Peer *p, lat::Socket *s)=0 |
virtual void | sendObjectListToPeer (Bucket *msg, bool all, bool clear)=0 |
virtual void | sendObjectListToPeers (bool all)=0 |
virtual void | sendObjectToPeer (Bucket *msg, Object &o, bool data) |
virtual bool | shouldStop (void) |
void | updateMask (Peer *p) |
virtual void | updatePeerMasks (void)=0 |
void | waitForData (Peer *p, const std::string &name, const std::string &info, Peer *owner) |
Static Protected Member Functions | |
static void | copydata (Bucket *b, const void *data, size_t len) |
static void | discard (Bucket *&b) |
Protected Attributes | |
bool | debug_ |
pthread_mutex_t | lock_ |
Private Member Functions | |
DQMNet (const DQMNet &) | |
void | losePeer (const char *reason, Peer *peer, lat::IOSelectEvent *event, lat::Error *err=0) |
bool | onLocalNotify (lat::IOSelectEvent *ev) |
bool | onPeerConnect (lat::IOSelectEvent *ev) |
bool | onPeerData (lat::IOSelectEvent *ev, Peer *p) |
Handle communication to a particular client. More... | |
DQMNet & | operator= (const DQMNet &) |
void | releaseFromWait (WaitList::iterator i, Object *o) |
void | releaseWaiters (const std::string &name, Object *o) |
void | requestObjectData (Peer *p, const char *name, size_t len) |
Queue an object request to the data server. More... | |
Private Attributes | |
std::string | appname_ |
pthread_t | communicate_ |
int | delay_ |
AutoPeer | downstream_ |
bool | flush_ |
int | pid_ |
lat::IOSelector | sel_ |
lat::Socket * | server_ |
sig_atomic_t | shutdown_ |
AutoPeer | upstream_ |
lat::Time | version_ |
WaitList | waiting_ |
lat::TimeSpan | waitMax_ |
lat::TimeSpan | waitStale_ |
lat::Pipe | wakeup_ |
typedef std::vector<unsigned char> DQMNet::DataBlob |
typedef std::vector<QValue> DQMNet::QReports |
typedef std::vector<uint32_t> DQMNet::TagList |
typedef std::list<WaitObject> DQMNet::WaitList |
|
private |
|
staticprotected |
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
void DQMNet::debug | ( | bool | doit | ) |
void DQMNet::delay | ( | int | delay | ) |
|
inlinestatic |
Definition at line 216 of file DQMNet.h.
Referenced by DQMService::flushStandalone().
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
void DQMNet::listenToCollector | ( | const std::string & | host, |
int | port | ||
) |
void DQMNet::lock | ( | void | ) |
|
private |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
private |
React to notifications from the DQM thread. This is a simple message to tell this thread to wake up and send unsollicited updates to the peers when new DQM data appears. We don't send the updates here, but just set a flag to tell the main event pump to send a notification later. This avoids sending unnecessarily frequent DQM object updates.
|
private |
|
private |
|
static |
Pack quality results in qr into a string into for peristent storage, such as network transfer or archival.
Definition at line 177 of file DQMNet.cc.
Referenced by DQMService::flushStandalone().
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
protectedvirtual |
|
private |
|
private |
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
private |
void DQMNet::run | ( | void | ) |
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
|
inlinestatic |
void DQMNet::shutdown | ( | void | ) |
void DQMNet::staleObjectWaitLimit | ( | lat::TimeSpan | time | ) |
void DQMNet::start | ( | void | ) |
void DQMNet::startLocalServer | ( | int | port | ) |
void DQMNet::startLocalServer | ( | const char * | path | ) |
void DQMNet::unlock | ( | void | ) |
|
static |
Unpack the quality results from string from into qr. Assumes the data was saved with packQualityData().
|
protected |
|
protectedpure virtual |
Implemented in DQMImplNet< ObjType >, and DQMImplNet< DQMNet::Object >.
void DQMNet::updateToCollector | ( | const std::string & | host, |
int | port | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |