XrdCnsLogFile Class Reference

#include <XrdCnsLogFile.hh>

List of all members.

Public Member Functions

int Add (XrdCnsLogRec *Rec, int doSync=1)
int Commit ()
int Eol ()
const char * FName ()
char * getLog (int &Dlen)
XrdCnsLogRecgetRec ()
int Open (int aBuff=1, off_t thePos=0)
XrdCnsLogFileSubscribe (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

XrdCnsLogFileNext

Private Member Functions

int Read (char *buff, int blen)

Private Attributes

XrdSysMutex logMutex
XrdSysSemaphore logSem
XrdSysSemaphore synSem
XrdCnsLogFilesubNext
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


Detailed Description

Definition at line 18 of file XrdCnsLogFile.hh.


Constructor & Destructor Documentation

XrdCnsLogFile::XrdCnsLogFile ( const char *  Path,
int  cnum = 0,
int  Wait = 1 
) [inline]

Definition at line 46 of file XrdCnsLogFile.hh.

Referenced by Subscribe().

XrdCnsLogFile::~XrdCnsLogFile (  ) 

Definition at line 46 of file XrdCnsLogFile.cc.

References close, free(), logBuff, logFD, logFN, synSem, and XrdSysSemaphore::Wait().


Member Function Documentation

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().


Member Data Documentation

XrdCnsLogFile* XrdCnsLogFile::Next

Definition at line 22 of file XrdCnsLogFile.hh.

Referenced by XrdCnsLogClient::Activate(), XrdCnsLogClient::Init(), XrdCnsLogClient::Manifest(), and XrdCnsLogClient::Run().

int XrdCnsLogFile::logRMax [static, private]

Definition at line 56 of file XrdCnsLogFile.hh.

Referenced by maxRecs().

int XrdCnsLogFile::logBMax [static, private]

Definition at line 57 of file XrdCnsLogFile.hh.

Referenced by maxRecs(), and Open().

XrdSysMutex XrdCnsLogFile::logMutex [private]

Definition at line 59 of file XrdCnsLogFile.hh.

XrdSysSemaphore XrdCnsLogFile::logSem [private]

Definition at line 60 of file XrdCnsLogFile.hh.

Referenced by Add(), Eol(), and getRec().

XrdSysSemaphore XrdCnsLogFile::synSem [private]

Definition at line 61 of file XrdCnsLogFile.hh.

Referenced by Eol(), Subscribe(), and ~XrdCnsLogFile().

XrdCnsLogFile* XrdCnsLogFile::subNext [private]

Definition at line 62 of file XrdCnsLogFile.hh.

Referenced by Add(), Eol(), and Subscribe().

XrdCnsLogRec XrdCnsLogFile::Rec [private]

Definition at line 64 of file XrdCnsLogFile.hh.

Referenced by Commit(), and getRec().

char* XrdCnsLogFile::logBuff [private]

Definition at line 66 of file XrdCnsLogFile.hh.

Referenced by getLog(), Open(), and ~XrdCnsLogFile().

char* XrdCnsLogFile::logNext [private]

Definition at line 67 of file XrdCnsLogFile.hh.

Referenced by getLog(), getRec(), and Open().

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]

Definition at line 71 of file XrdCnsLogFile.hh.

Referenced by Commit(), and getRec().

int XrdCnsLogFile::logWait [private]

Definition at line 72 of file XrdCnsLogFile.hh.

Referenced by Eol(), getRec(), Open(), and Subscribe().

int XrdCnsLogFile::logOffset [private]

Definition at line 73 of file XrdCnsLogFile.hh.

Referenced by Commit(), getRec(), and Read().

int XrdCnsLogFile::recOffset [private]

Definition at line 74 of file XrdCnsLogFile.hh.

Referenced by Commit(), and getRec().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:50:26 2011 for ROOT_528-00b_version by  doxygen 1.5.1