|
xrootd
|
#include <XrdCnsLogClient.hh>

Public Member Functions | |
| int | Activate (XrdCnsLogFile *basefile) |
| int | Init () |
| int | Run (int Always=1) |
| int | Start () |
| XrdCnsLogClient (XrdOucTList *rP, XrdCnsLogClient *pcP) | |
| ~XrdCnsLogClient () | |
Private Member Functions | |
| XrdClientAdmin * | admConnect (XrdClientAdmin *adminP) |
| int | Archive (XrdCnsLogFile *lfP) |
| int | do_Create (XrdCnsLogRec *lrP, const char *lfn=0) |
| int | do_Mkdir (XrdCnsLogRec *lrP) |
| int | do_Mv (XrdCnsLogRec *lrP) |
| int | do_Rm (XrdCnsLogRec *lrP) |
| int | do_Rmdir (XrdCnsLogRec *lrP) |
| int | do_Trunc (XrdCnsLogRec *lrP, const char *lfn=0) |
| char | getMount (char *Lfn, char *Pfn, XrdCnsXref &Mount) |
| int | Inventory (XrdCnsLogFile *lfp, const char *dPath) |
| int | Manifest () |
| int | mapError (int rc) |
| int | xrdEmsg (const char *Opname, const char *theFN, XrdClientAdmin *aP) |
| int | xrdEmsg (const char *Opname, const char *theFN) |
| int | xrdEmsg (const char *Opname, const char *theFN, XrdClient *fP) |
Private Attributes | |
| XrdSysMutex | lfMutex |
| XrdSysSemaphore | lfSem |
| XrdCnsLogClient * | Next |
| XrdClientAdmin * | Admin |
| XrdCnsLogFile * | logFirst |
| XrdCnsLogFile * | logLast |
| int | pfxNF |
| int | sfxFN |
| int | arkOnly |
| char * | admURL |
| char * | urlHost |
| char | arkURL [MAXPATHLEN+512] |
| char * | arkPath |
| char * | arkFN |
| char | crtURL [MAXPATHLEN+512] |
| char * | crtFN |
| char | logDir [MAXPATHLEN+1] |
| char * | logFN |
| XrdCnsLogClient::XrdCnsLogClient | ( | XrdOucTList * | rP, |
| XrdCnsLogClient * | pcP | ||
| ) |
References XrdSysDNS::getHostName(), pfxNF, Next, sfxFN, logFirst, logLast, urlHost, XrdOucTList::text, logDir, XrdCms::Config, logFN, crtFN, crtURL, admURL, Admin, arkOnly, XrdOucTList::val, arkURL, arkFN, arkPath, XrdCns::MLog, and XrdSysError::Emsg().
| XrdCnsLogClient::~XrdCnsLogClient | ( | ) | [inline] |
| int XrdCnsLogClient::Activate | ( | XrdCnsLogFile * | basefile | ) |
References sfxFN, logFN, pfxNF, XrdCnsLogFile::Subscribe(), logDir, lfMutex, XrdSysMutex::Lock(), logLast, XrdCnsLogFile::Next, logFirst, lfSem, XrdSysSemaphore::Post(), XrdSysMutex::UnLock(), Next, and Activate().
Referenced by Activate().
| XrdClientAdmin * XrdCnsLogClient::admConnect | ( | XrdClientAdmin * | adminP | ) | [private] |
References XrdSysMutex::Lock(), admURL, XrdSysMutex::UnLock(), TRACE, DEBUG, urlHost, XrdClientAdmin::Connect(), xrdEmsg(), and XrdSysTimer::Snooze().
Referenced by Run().
| int XrdCnsLogClient::Archive | ( | XrdCnsLogFile * | lfP | ) | [private] |
References kXR_open_updt, kXR_delete, kXR_mkpath, kXR_ur, kXR_uw, kXR_gr, kXR_gw, kXR_or, XrdCnsLogFile::getLog(), arkFN, rindex, XrdCnsLogFile::FName(), XrdCns::MLog, XrdSysError::Emsg(), arkURL, XrdClient::Open(), XrdClientAbs::LastServerResp(), ServerResponseHeader::status, kXR_ok, xrdEmsg(), XrdClient::Write(), arkPath, Admin, XrdClientAdmin::Mv(), and XrdClientAdmin::Rm().
Referenced by Run().
| int XrdCnsLogClient::do_Create | ( | XrdCnsLogRec * | lrP, |
| const char * | lfn = 0 |
||
| ) | [private] |
References kXR_open_updt, kXR_delete, kXR_mkpath, kXR_ur, kXR_uw, XrdCnsLogRec::Mode(), S_IRGRP, kXR_gr, S_IWGRP, kXR_gw, S_IROTH, kXR_or, crtFN, XrdCnsLogRec::Lfn1(), XrdCms::Config, XrdCnsLogRec::Space(), crtURL, XrdClient::Open(), XrdClientAbs::LastServerResp(), ServerResponseHeader::status, kXR_ok, and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Mkdir | ( | XrdCnsLogRec * | lrP | ) | [private] |
References Admin, XrdClientAdmin::Mkdir(), XrdCnsLogRec::Lfn1(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Mv | ( | XrdCnsLogRec * | lrP | ) | [private] |
References Admin, XrdClientAdmin::Mv(), XrdCnsLogRec::Lfn1(), XrdCnsLogRec::Lfn2(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Rm | ( | XrdCnsLogRec * | lrP | ) | [private] |
References Admin, XrdClientAdmin::Rm(), XrdCnsLogRec::Lfn1(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Rmdir | ( | XrdCnsLogRec * | lrP | ) | [private] |
References Admin, XrdClientAdmin::Rmdir(), XrdCnsLogRec::Lfn1(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Trunc | ( | XrdCnsLogRec * | lrP, |
| const char * | lfn = 0 |
||
| ) | [private] |
References Admin, XrdClientAdmin::Truncate(), XrdCnsLogRec::Lfn1(), XrdCnsLogRec::Size(), and xrdEmsg().
Referenced by Run().
| char XrdCnsLogClient::getMount | ( | char * | Lfn, |
| char * | Pfn, | ||
| XrdCnsXref & | Mount | ||
| ) | [private] |
| int XrdCnsLogClient::Init | ( | ) |
References Mode, S_IRWXU, S_IRWXG, S_IROTH, S_IXOTH, logFN, XrdCnsLog::invFNa, unlink(), logDir, XrdOucUtils::makePath(), XrdCns::MLog, XrdSysError::Emsg(), XrdCnsLog::List(), XrdCms::Config, XrdCnsConfig::optRecr, XrdOucNSWalk::NSEnt::Next, XrdOucNSWalk::NSEnt::Stat, logLast, XrdCnsLogFile::Next, logFirst, urlHost, and Run().
| int XrdCnsLogClient::Inventory | ( | XrdCnsLogFile * | lfp, |
| const char * | dPath | ||
| ) | [private] |
Referenced by Manifest().
| int XrdCnsLogClient::Manifest | ( | ) | [private] |
References Inventory(), lfMutex, XrdSysMutex::Lock(), logFirst, rindex, XrdCnsLogFile::FName(), XrdCnsLog::invFNz, XrdSysMutex::UnLock(), arkFN, Admin, XrdClientAdmin::Stat(), arkPath, XrdClientAbs::LastServerError(), ServerResponseBody_Error::errnum, kXR_NotFound, xrdEmsg(), TRACE, DEBUG, logFN, XrdCnsLog::invFNa, logDir, XrdCnsLogFile::Open(), XrdCnsInventory::Init(), XrdCms::Config, XrdCnsInventory::Conduct(), XrdOucTList::text, XrdOucTList::next, XrdCnsLogFile::Eol(), unlink(), XrdCnsLog::invFNt, rename(), XrdCns::MLog, XrdSysError::Emsg(), XrdCnsLogFile::Next, and logLast.
Referenced by Run().
| int XrdCnsLogClient::mapError | ( | int | rc | ) | [private] |
References kXR_NotFound, kXR_NotAuthorized, kXR_IOError, kXR_NoMemory, kXR_NoSpace, kXR_ArgTooLong, kXR_noserver, EHOSTUNREACH, kXR_NotFile, kXR_isDirectory, and kXR_FSError.
Referenced by xrdEmsg().
| int XrdCnsLogClient::Run | ( | int | Always = 1 | ) |
References arkFN, Manifest(), Admin, admConnect(), XrdCns::MLog, XrdSysError::Emsg(), arkURL, XrdCms::Config, lfMutex, XrdSysMutex::Lock(), logFirst, XrdCnsLogFile::Next, logLast, XrdSysMutex::UnLock(), lfSem, XrdSysSemaphore::Wait(), XrdCnsLogFile::Open(), XrdCnsLogFile::getRec(), arkOnly, TRACE, DEBUG, urlHost, XrdCnsLogRec::Data(), XrdCnsLogRec::Type(), do_Trunc(), do_Create(), XrdCnsLogRec::Lfn1(), do_Mkdir(), do_Mv(), do_Rm(), do_Rmdir(), XrdCnsLogRec::Space(), XrdCnsLogFile::Commit(), Archive(), and XrdCnsLogFile::Unlink().
Referenced by Init(), and XrdCns::StartLogClient().
| int XrdCnsLogClient::Start | ( | ) |
References XrdSysThread::Run(), XrdCns::StartLogClient(), XRDSYSTHREAD_BIND, XrdCns::MLog, XrdSysError::Emsg(), Next, and Start().
Referenced by Start().
| int XrdCnsLogClient::xrdEmsg | ( | const char * | Opname, |
| const char * | theFN, | ||
| XrdClientAdmin * | aP | ||
| ) | [private] |
References XrdClientAbs::LastServerError(), ServerResponseBody_Error::errmsg, mapError(), ServerResponseBody_Error::errnum, XrdCns::MLog, and XrdSysError::Emsg().
Referenced by admConnect(), Archive(), do_Create(), do_Mkdir(), do_Mv(), do_Rm(), do_Rmdir(), do_Trunc(), Manifest(), and xrdEmsg().
| int XrdCnsLogClient::xrdEmsg | ( | const char * | Opname, |
| const char * | theFN | ||
| ) | [private] |
| int XrdCnsLogClient::xrdEmsg | ( | const char * | Opname, |
| const char * | theFN, | ||
| XrdClient * | fP | ||
| ) | [private] |
XrdClientAdmin* XrdCnsLogClient::Admin [private] |
Referenced by XrdCnsLogClient(), Run(), Archive(), do_Mkdir(), do_Mv(), do_Rm(), do_Rmdir(), do_Trunc(), Manifest(), and xrdEmsg().
char* XrdCnsLogClient::admURL [private] |
Referenced by XrdCnsLogClient(), and admConnect().
char* XrdCnsLogClient::arkFN [private] |
Referenced by XrdCnsLogClient(), Run(), Archive(), and Manifest().
int XrdCnsLogClient::arkOnly [private] |
Referenced by XrdCnsLogClient(), and Run().
char* XrdCnsLogClient::arkPath [private] |
Referenced by XrdCnsLogClient(), Archive(), and Manifest().
char XrdCnsLogClient::arkURL[MAXPATHLEN+512] [private] |
Referenced by XrdCnsLogClient(), Run(), and Archive().
char* XrdCnsLogClient::crtFN [private] |
Referenced by XrdCnsLogClient(), and do_Create().
char XrdCnsLogClient::crtURL[MAXPATHLEN+512] [private] |
Referenced by XrdCnsLogClient(), and do_Create().
XrdSysMutex XrdCnsLogClient::lfMutex [private] |
Referenced by Activate(), Run(), and Manifest().
XrdSysSemaphore XrdCnsLogClient::lfSem [private] |
Referenced by Activate(), and Run().
char XrdCnsLogClient::logDir[MAXPATHLEN+1] [private] |
Referenced by XrdCnsLogClient(), Activate(), Init(), and Manifest().
XrdCnsLogFile* XrdCnsLogClient::logFirst [private] |
Referenced by XrdCnsLogClient(), Activate(), Init(), Run(), and Manifest().
char* XrdCnsLogClient::logFN [private] |
Referenced by XrdCnsLogClient(), Activate(), Init(), and Manifest().
XrdCnsLogFile* XrdCnsLogClient::logLast [private] |
Referenced by XrdCnsLogClient(), Activate(), Init(), Run(), and Manifest().
XrdCnsLogClient* XrdCnsLogClient::Next [private] |
Referenced by XrdCnsLogClient(), Activate(), and Start().
int XrdCnsLogClient::pfxNF [private] |
Referenced by XrdCnsLogClient(), and Activate().
int XrdCnsLogClient::sfxFN [private] |
Referenced by XrdCnsLogClient(), and Activate().
char* XrdCnsLogClient::urlHost [private] |
Referenced by XrdCnsLogClient(), Init(), Run(), and admConnect().
1.7.5