#include <XrdCnsLogFile.hh>
Public Member Functions | |
int | Add (XrdCnsLogRec *Rec, int doSync=1) |
int | Commit () |
int | Eol () |
const char * | FName () |
char * | getLog (int &Dlen) |
XrdCnsLogRec * | getRec () |
int | Open (int aBuff=1, off_t thePos=0) |
XrdCnsLogFile * | Subscribe (const char *Path, int cNum) |
int | Unlink () |
XrdCnsLogFile (const char *Path, int cnum=0, int Wait=1) | |
~XrdCnsLogFile () | |
Static Public Member Functions | |
static void | maxRecs (int nRecs) |
Public Attributes | |
XrdCnsLogFile * | Next |
Private Member Functions | |
int | Read (char *buff, int blen) |
Private Attributes | |
XrdSysMutex | logMutex |
XrdSysSemaphore | logSem |
XrdSysSemaphore | synSem |
XrdCnsLogFile * | subNext |
XrdCnsLogRec | Rec |
char * | logBuff |
char * | logNext |
char * | logFN |
int | logFD |
int | logRdr |
int | logWait |
int | logOffset |
int | recOffset |
Static Private Attributes | |
static int | logRMax |
static int | logBMax |
Definition at line 18 of file XrdCnsLogFile.hh.
XrdCnsLogFile::XrdCnsLogFile | ( | const char * | Path, | |
int | cnum = 0 , |
|||
int | Wait = 1 | |||
) | [inline] |
XrdCnsLogFile::~XrdCnsLogFile | ( | ) |
Definition at line 46 of file XrdCnsLogFile.cc.
References close, free(), logBuff, logFD, logFN, synSem, and XrdSysSemaphore::Wait().
int XrdCnsLogFile::Add | ( | XrdCnsLogRec * | Rec, | |
int | doSync = 1 | |||
) |
Definition at line 63 of file XrdCnsLogFile.cc.
References XrdSysError::Emsg(), fdatasync(), logFD, logFN, logSem, XrdCnsLogRec::MinSize, XrdCns::MLog, XrdSysSemaphore::Post(), XrdCnsLogRec::Record(), XrdCnsLogRec::setLen(), subNext, and write.
Referenced by XrdCnsInventory::Conduct(), XrdCnsInventory::Init(), XrdCnsLogServer::Run(), and XrdCnsInventory::Xref().
int XrdCnsLogFile::Commit | ( | ) |
Definition at line 100 of file XrdCnsLogFile.cc.
References XrdSysError::Emsg(), fdatasync(), logFD, logFN, logOffset, logRdr, XrdCns::MLog, XrdCnsLogRec::OffDone, pwrite, Rec, recOffset, and XrdCnsLogRec::setDone().
Referenced by XrdCnsLogClient::Run().
int XrdCnsLogFile::Eol | ( | ) |
Definition at line 123 of file XrdCnsLogFile.cc.
References XrdCnsLogRec::DLen(), XrdSysError::Emsg(), logFD, logFN, logSem, logWait, XrdCnsLogRec::lrEOL, XrdCnsLogRec::MinSize, XrdCns::MLog, XrdSysSemaphore::Post(), subNext, synSem, and write.
Referenced by XrdCnsLogServer::Init(), XrdCnsLogClient::Manifest(), and XrdCnsLogServer::Run().
const char* XrdCnsLogFile::FName | ( | ) | [inline] |
Definition at line 30 of file XrdCnsLogFile.hh.
References logFN.
Referenced by XrdCnsLogClient::Archive(), and XrdCnsLogClient::Manifest().
char* XrdCnsLogFile::getLog | ( | int & | Dlen | ) | [inline] |
Definition at line 32 of file XrdCnsLogFile.hh.
References logBuff, and logNext.
Referenced by XrdCnsLogClient::Archive().
XrdCnsLogRec * XrdCnsLogFile::getRec | ( | ) |
Definition at line 158 of file XrdCnsLogFile.cc.
References XrdCnsLogRec::DLen(), XrdCnsLogRec::Done(), XrdSysError::Emsg(), XrdCnsLogRec::FixDLen, XrdCnsLogRec::L1sz(), XrdCnsLogRec::L2sz(), logFN, logNext, logOffset, logRdr, logSem, logWait, XrdCnsLogRec::MinSize, XrdCns::MLog, Read(), Rec, recOffset, XrdCnsLogRec::Record(), and XrdSysSemaphore::Wait().
Referenced by XrdCnsLogClient::Run().
static void XrdCnsLogFile::maxRecs | ( | int | nRecs | ) | [inline, static] |
Definition at line 36 of file XrdCnsLogFile.hh.
References logBMax, and logRMax.
Referenced by XrdCnsLogServer::Init().
int XrdCnsLogFile::Open | ( | int | aBuff = 1 , |
|
off_t | thePos = 0 | |||
) |
Definition at line 196 of file XrdCnsLogFile.cc.
References close, XrdSysError::Emsg(), fstat, logBMax, logBuff, logFD, logFN, logNext, logWait, lseek, malloc(), XrdCns::MLog, open, S_IRGRP, S_IROTH, S_IRUSR, S_IWUSR, SEEK_SET, and stat.
Referenced by XrdCnsLogServer::Init(), XrdCnsLogClient::Manifest(), XrdCnsLogServer::Run(), and XrdCnsLogClient::Run().
XrdCnsLogFile * XrdCnsLogFile::Subscribe | ( | const char * | Path, | |
int | cNum | |||
) |
Definition at line 249 of file XrdCnsLogFile.cc.
References XrdSysError::Emsg(), logFN, logWait, XrdCns::MLog, subNext, synSem, XrdSysSemaphore::Wait(), and XrdCnsLogFile().
Referenced by XrdCnsLogClient::Activate().
int XrdCnsLogFile::Unlink | ( | ) |
Definition at line 278 of file XrdCnsLogFile.cc.
References XrdSysError::Emsg(), logFN, XrdCns::MLog, and unlink.
Referenced by XrdCnsLogServer::Run(), and XrdCnsLogClient::Run().
int XrdCnsLogFile::Read | ( | char * | buff, | |
int | blen | |||
) | [private] |
Definition at line 229 of file XrdCnsLogFile.cc.
References XrdSysError::Emsg(), logFD, logFN, logOffset, XrdCns::MLog, and pread.
Referenced by getRec().
Definition at line 22 of file XrdCnsLogFile.hh.
Referenced by XrdCnsLogClient::Activate(), XrdCnsLogClient::Init(), XrdCnsLogClient::Manifest(), and XrdCnsLogClient::Run().
int XrdCnsLogFile::logRMax [static, private] |
int XrdCnsLogFile::logBMax [static, private] |
XrdSysMutex XrdCnsLogFile::logMutex [private] |
Definition at line 59 of file XrdCnsLogFile.hh.
XrdSysSemaphore XrdCnsLogFile::logSem [private] |
XrdSysSemaphore XrdCnsLogFile::synSem [private] |
Definition at line 61 of file XrdCnsLogFile.hh.
Referenced by Eol(), Subscribe(), and ~XrdCnsLogFile().
XrdCnsLogFile* XrdCnsLogFile::subNext [private] |
XrdCnsLogRec XrdCnsLogFile::Rec [private] |
char* XrdCnsLogFile::logBuff [private] |
Definition at line 66 of file XrdCnsLogFile.hh.
Referenced by getLog(), Open(), and ~XrdCnsLogFile().
char* XrdCnsLogFile::logNext [private] |
char* XrdCnsLogFile::logFN [private] |
Definition at line 69 of file XrdCnsLogFile.hh.
Referenced by Add(), Commit(), Eol(), FName(), getRec(), Open(), Read(), Subscribe(), Unlink(), and ~XrdCnsLogFile().
int XrdCnsLogFile::logFD [private] |
Definition at line 70 of file XrdCnsLogFile.hh.
Referenced by Add(), Commit(), Eol(), Open(), Read(), and ~XrdCnsLogFile().
int XrdCnsLogFile::logRdr [private] |
int XrdCnsLogFile::logWait [private] |
Definition at line 72 of file XrdCnsLogFile.hh.
Referenced by Eol(), getRec(), Open(), and Subscribe().
int XrdCnsLogFile::logOffset [private] |
int XrdCnsLogFile::recOffset [private] |