xrootd
|
#include <XrdOfsEvs.hh>
Public Types | |
enum | Event { All = 0x7fffff00, None = 0x00000000, Chmod = 0x00000100, Closer = 0x00000201, Closew = 0x00000402, Close = 0x00000600, Create = 0x00000803, Fwrite = 0x00001004, Mkdir = 0x00002005, Mv = 0x00004006, Openr = 0x00008007, Openw = 0x00010008, Open = 0x00018000, Rm = 0x00020009, Rmdir = 0x0004000a, Trunc = 0x0008000b, nCount = 12, Mask = 0X000000ff, enMask = 0x7fffff00 } |
Public Member Functions | |
int | Enabled (Event theEvents) |
int | maxSmsg () |
int | maxLmsg () |
void | Notify (Event eNum, XrdOfsEvsInfo &Info) |
const char * | Prog () |
void | sendEvents (void) |
int | Start (XrdSysError *eobj) |
XrdOfsEvs (Event theEvents, const char *Target, int minq=90, int maxq=10) | |
~XrdOfsEvs () | |
Static Public Member Functions | |
static int | Parse (XrdSysError &Eroute, Event eNum, char *mText) |
Static Public Attributes | |
static const int | minMsgSize = 1360 |
static const int | maxMsgSize = 2384 |
Private Member Functions | |
const char * | eName (int eNum) |
int | Feed (const char *data, int dlen) |
XrdOfsEvsMsg * | getMsg (int bigmsg) |
void | retMsg (XrdOfsEvsMsg *tp) |
Private Attributes | |
pthread_t | tid |
char * | theTarget |
Event | enEvents |
XrdSysError * | eDest |
XrdOucProg * | theProg |
XrdSysMutex | qMut |
XrdSysSemaphore | qSem |
XrdOfsEvsMsg * | msgFirst |
XrdOfsEvsMsg * | msgLast |
XrdSysMutex | fMut |
XrdOfsEvsMsg * | msgFreeMax |
XrdOfsEvsMsg * | msgFreeMin |
int | endIT |
int | msgFD |
int | numMax |
int | maxMax |
int | numMin |
int | maxMin |
Static Private Attributes | |
static XrdOfsEvsFormat | MsgFmt [XrdOfsEvs::nCount] |
enum XrdOfsEvs::Event |
XrdOfsEvs::XrdOfsEvs | ( | Event | theEvents, |
const char * | Target, | ||
int | minq = 90 , |
||
int | maxq = 10 |
||
) |
References Chmod, Closer, Closew, Create, XrdOfsEvsFormat::cvtFSize, XrdOfsEvsFormat::cvtMode, XrdOfsEvsFormat::Def(), eDest, endIT, enEvents, enMask, XrdOfsEvsInfo::evFMODE, XrdOfsEvsInfo::evFSIZE, XrdOfsEvsInfo::evLFN1, XrdOfsEvsInfo::evLFN2, XrdOfsEvsInfo::evTID, Fwrite, Mask, maxMax, maxMin, Mkdir, msgFD, msgFirst, MsgFmt, msgFreeMax, msgFreeMin, msgLast, Mv, XrdOfsEvsFormat::Null, numMax, numMin, Openr, Openw, Rm, Rmdir, theProg, theTarget, tid, and Trunc.
XrdOfsEvs::~XrdOfsEvs | ( | ) |
References close, endIT, fMut, XrdSysThread::Kill(), XrdSysMutex::Lock(), msgFD, msgFirst, msgFreeMax, msgFreeMin, XrdOfsEvsMsg::next, qMut, theProg, theTarget, tid, and XrdSysMutex::UnLock().
int XrdOfsEvs::Enabled | ( | Event | theEvents | ) | [inline] |
const char * XrdOfsEvs::eName | ( | int | eNum | ) | [private] |
int XrdOfsEvs::Feed | ( | const char * | data, |
int | dlen | ||
) | [private] |
References eDest, XrdSysError::Emsg(), msgFD, theTarget, and write().
Referenced by sendEvents().
XrdOfsEvsMsg * XrdOfsEvs::getMsg | ( | int | bigmsg | ) | [private] |
References fMut, XrdSysMutex::Lock(), maxMax, maxMin, maxMsgSize, minMsgSize, msgFreeMax, msgFreeMin, XrdOfsEvsMsg::next, numMax, numMin, XrdOfsEvsMsg::text, and XrdSysMutex::UnLock().
Referenced by Notify().
int XrdOfsEvs::maxLmsg | ( | ) | [inline] |
References maxMax.
Referenced by XrdOfs::Config_Display().
int XrdOfsEvs::maxSmsg | ( | ) | [inline] |
References maxMin.
Referenced by XrdOfs::Config_Display().
void XrdOfsEvs::Notify | ( | Event | eNum, |
XrdOfsEvsInfo & | Info | ||
) |
References XrdOfsEvsFormat::cvtFSize, XrdOfsEvsFormat::cvtMode, eDest, XrdSysError::Emsg(), eName(), XrdOfsEvsInfo::evFMODE, XrdOfsEvsInfo::evFSIZE, XrdOfsEvsFormat::Flags, XrdOfsEvsInfo::FMode(), XrdOfsEvsInfo::FSize(), getMsg(), XrdSysMutex::Lock(), Mask, maxMsgSize, minMsgSize, msgFirst, MsgFmt, msgLast, Mv, nCount, XrdOfsEvsMsg::next, XrdSysSemaphore::Post(), qMut, qSem, S_IAMB, XrdOfsEvsInfo::Set(), XrdOfsEvsFormat::SNP(), XrdOfsEvsMsg::text, XrdOfsEvsMsg::tlen, and XrdSysMutex::UnLock().
Referenced by XrdOfs::chmod(), XrdOfsFile::close(), XrdOfsFile::GenFWEvent(), XrdOfs::mkdir(), XrdOfsFile::open(), XrdOfs::remove(), XrdOfs::rename(), XrdOfs::truncate(), and XrdOfs::Unpersist().
int XrdOfsEvs::Parse | ( | XrdSysError & | Eroute, |
XrdOfsEvs::Event | eNum, | ||
char * | mText | ||
) | [static] |
References XrdOfsEvsFormat::cvtFSize, XrdOfsEvsFormat::cvtMode, XrdSysError::Emsg(), XrdOfsEvsInfo::evARGS, XrdOfsEvsInfo::evCGI1, XrdOfsEvsInfo::evCGI2, XrdOfsEvsInfo::evFMODE, XrdOfsEvsInfo::evFSIZE, XrdOfsEvsInfo::evLFN1, XrdOfsEvsInfo::evLFN2, XrdOfsEvsInfo::evTID, XrdOfsEvsFormat::freeFmt, index(), Mask, MsgFmt, XrdOfsEvsFormat::Null, XrdSysError::Say(), and XrdOfsEvsFormat::Set().
Referenced by XrdOfs::xnmsg().
const char* XrdOfsEvs::Prog | ( | ) | [inline] |
References theTarget.
Referenced by XrdOfs::Config_Display().
void XrdOfsEvs::retMsg | ( | XrdOfsEvsMsg * | tp | ) | [private] |
References fMut, XrdOfsEvsMsg::isBig, XrdSysMutex::Lock(), maxMax, maxMin, msgFreeMax, msgFreeMin, XrdOfsEvsMsg::next, numMax, numMin, and XrdSysMutex::UnLock().
Referenced by sendEvents().
void XrdOfsEvs::sendEvents | ( | void | ) |
References endIT, XrdOucProg::Feed(), Feed(), XrdSysMutex::Lock(), msgFirst, msgLast, XrdOfsEvsMsg::next, qMut, qSem, retMsg(), XrdOfsEvsMsg::text, theProg, XrdOfsEvsMsg::tlen, XrdSysMutex::UnLock(), and XrdSysSemaphore::Wait().
Referenced by XrdOfsEvsSend().
int XrdOfsEvs::Start | ( | XrdSysError * | eobj | ) |
References XrdNetSocket::Create(), XrdNetSocket::Detach(), eDest, XrdSysError::Emsg(), msgFD, XrdSysThread::Run(), XrdOucProg::Setup(), XrdOucProg::Start(), theProg, theTarget, tid, XRDNET_FIFO, and XrdOfsEvsSend().
Referenced by XrdOfs::Configure().
XrdSysError* XrdOfsEvs::eDest [private] |
Referenced by Feed(), Notify(), Start(), and XrdOfsEvs().
int XrdOfsEvs::endIT [private] |
Referenced by sendEvents(), XrdOfsEvs(), and ~XrdOfsEvs().
Event XrdOfsEvs::enEvents [private] |
Referenced by Enabled(), and XrdOfsEvs().
XrdSysMutex XrdOfsEvs::fMut [private] |
Referenced by getMsg(), retMsg(), and ~XrdOfsEvs().
int XrdOfsEvs::maxMax [private] |
Referenced by getMsg(), maxLmsg(), retMsg(), and XrdOfsEvs().
int XrdOfsEvs::maxMin [private] |
Referenced by getMsg(), maxSmsg(), retMsg(), and XrdOfsEvs().
const int XrdOfsEvs::maxMsgSize = 2384 [static] |
const int XrdOfsEvs::minMsgSize = 1360 [static] |
int XrdOfsEvs::msgFD [private] |
Referenced by Feed(), Start(), XrdOfsEvs(), and ~XrdOfsEvs().
XrdOfsEvsMsg* XrdOfsEvs::msgFirst [private] |
Referenced by Notify(), sendEvents(), XrdOfsEvs(), and ~XrdOfsEvs().
XrdOfsEvsFormat XrdOfsEvs::MsgFmt [static, private] |
Referenced by Notify(), Parse(), and XrdOfsEvs().
XrdOfsEvsMsg* XrdOfsEvs::msgFreeMax [private] |
Referenced by getMsg(), retMsg(), XrdOfsEvs(), and ~XrdOfsEvs().
XrdOfsEvsMsg* XrdOfsEvs::msgFreeMin [private] |
Referenced by getMsg(), retMsg(), XrdOfsEvs(), and ~XrdOfsEvs().
XrdOfsEvsMsg* XrdOfsEvs::msgLast [private] |
Referenced by Notify(), sendEvents(), and XrdOfsEvs().
int XrdOfsEvs::numMax [private] |
Referenced by getMsg(), retMsg(), and XrdOfsEvs().
int XrdOfsEvs::numMin [private] |
Referenced by getMsg(), retMsg(), and XrdOfsEvs().
XrdSysMutex XrdOfsEvs::qMut [private] |
Referenced by Notify(), sendEvents(), and ~XrdOfsEvs().
XrdSysSemaphore XrdOfsEvs::qSem [private] |
Referenced by Notify(), and sendEvents().
XrdOucProg* XrdOfsEvs::theProg [private] |
Referenced by sendEvents(), Start(), XrdOfsEvs(), and ~XrdOfsEvs().
char* XrdOfsEvs::theTarget [private] |
Referenced by Feed(), Prog(), Start(), XrdOfsEvs(), and ~XrdOfsEvs().
pthread_t XrdOfsEvs::tid [private] |
Referenced by Start(), XrdOfsEvs(), and ~XrdOfsEvs().