#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 |
Definition at line 26 of file XrdCnsLogClient.hh.
| XrdCnsLogClient::XrdCnsLogClient | ( | XrdOucTList * | rP, | |
| XrdCnsLogClient * | pcP | |||
| ) |
Definition at line 63 of file XrdCnsLogClient.cc.
References Admin, admURL, arkFN, arkOnly, arkPath, arkURL, XrdFrm::Config(), crtFN, crtURL, XrdSysError::Emsg(), XrdNetDNS::getHostName(), logDir, logFirst, logFN, logLast, XrdCns::MLog, Next, XrdCnsConfig::optNoCns, pfxNF, sfxFN, sprintf(), strcat(), strcpy(), XrdOucTList::text, urlHost, and XrdOucTList::val.
| XrdCnsLogClient::~XrdCnsLogClient | ( | ) | [inline] |
Definition at line 39 of file XrdCnsLogClient.hh.
| int XrdCnsLogClient::Activate | ( | XrdCnsLogFile * | basefile | ) |
Definition at line 114 of file XrdCnsLogClient.cc.
References Activate(), lfMutex, lfSem, XrdSysMutex::Lock(), logDir, logFirst, logFN, logLast, XrdCnsLogFile::Next, Next, pfxNF, XrdSysSemaphore::Post(), sfxFN, sprintf(), XrdCnsLogFile::Subscribe(), and XrdSysMutex::UnLock().
Referenced by Activate(), XrdCnsLogServer::Init(), and XrdCnsLogServer::Run().
| int XrdCnsLogClient::Init | ( | ) |
Definition at line 143 of file XrdCnsLogClient.cc.
References XrdFrm::Config(), XrdSysError::Emsg(), XrdCnsLog::invFNa, XrdCnsLog::List(), logDir, logFirst, logFN, logLast, XrdOucUtils::makePath(), XrdCns::MLog, Mode, XrdCnsLogFile::Next, XrdOucNSWalk::NSEnt::Next, XrdCnsConfig::optRecr, Run(), S_IROTH, S_IRWXG, S_IRWXU, S_IXOTH, XrdOucNSWalk::NSEnt::Stat, strcpy(), unlink, and urlHost.
Referenced by XrdCnsLogServer::Init().
| int XrdCnsLogClient::Run | ( | int | Always = 1 |
) |
Definition at line 208 of file XrdCnsLogClient.cc.
References admConnect(), Admin, Archive(), arkFN, arkOnly, arkURL, XrdCnsLogFile::Commit(), XrdFrm::Config(), XrdCnsLogRec::Data(), DEBUG, do_Create(), do_Mkdir(), do_Mv(), do_Rm(), do_Rmdir(), do_Trunc(), XrdSysError::Emsg(), XrdCnsLogFile::getRec(), lfMutex, lfSem, XrdSysMutex::Lock(), logFirst, logLast, XrdCnsLogRec::lrClosew, XrdCnsLogRec::lrCreate, XrdCnsLogRec::lrInvD, XrdCnsLogRec::lrInvF, XrdCnsLogRec::lrMkdir, XrdCnsLogRec::lrMount, XrdCnsLogRec::lrMv, XrdCnsLogRec::lrRm, XrdCnsLogRec::lrRmdir, XrdCnsLogRec::lrSpace, XrdCnsLogRec::lrTOD, Manifest(), XrdCns::MLog, n, XrdCnsLogFile::Next, Ok(), XrdCnsLogFile::Open(), XrdFrmConfig::Space(), strcpy(), TRACE, XrdCnsLogRec::Type(), XrdCnsLogFile::Unlink(), XrdSysMutex::UnLock(), urlHost, and XrdSysSemaphore::Wait().
Referenced by Init(), and XrdCns::StartLogClient().
| int XrdCnsLogClient::Start | ( | ) |
Definition at line 296 of file XrdCnsLogClient.cc.
References XrdSysError::Emsg(), XrdCns::MLog, Next, XrdSysThread::Run(), Start(), XrdCns::StartLogClient(), and XRDSYSTHREAD_BIND.
Referenced by XrdCnsLogServer::Init(), and Start().
| XrdClientAdmin * XrdCnsLogClient::admConnect | ( | XrdClientAdmin * | adminP | ) | [private] |
Definition at line 323 of file XrdCnsLogClient.cc.
References admURL, XrdClientAdmin::Connect(), DEBUG, XrdSysMutex::Lock(), XrdSysTimer::Snooze(), TRACE, XrdSysMutex::UnLock(), urlHost, and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::Archive | ( | XrdCnsLogFile * | lfP | ) | [private] |
Definition at line 355 of file XrdCnsLogClient.cc.
References Admin, arkFN, arkPath, arkURL, XrdSysError::Emsg(), XrdCnsLogFile::FName(), XrdCnsLogFile::getLog(), kXR_delete, kXR_gr, kXR_gw, kXR_mkpath, kXR_ok, kXR_open_updt, kXR_or, kXR_ur, kXR_uw, XrdClientAbs::LastServerResp(), XrdCns::MLog, XrdClientAdmin::Mv(), XrdClient::Open(), rindex, XrdClientAdmin::Rm(), ServerResponseHeader::status, strcpy(), XrdClient::Write(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Create | ( | XrdCnsLogRec * | lrP, | |
| const char * | lfn = 0 | |||
| ) | [private] |
Definition at line 405 of file XrdCnsLogClient.cc.
References XrdFrm::Config(), crtFN, crtURL, kXR_delete, kXR_gr, kXR_gw, kXR_mkpath, kXR_ok, kXR_open_updt, kXR_or, kXR_ur, kXR_uw, XrdClientAbs::LastServerResp(), XrdCnsLogRec::Lfn1(), XrdCnsLogRec::Mode(), Ok(), XrdClient::Open(), S_IRGRP, S_IROTH, S_IWGRP, XrdCnsLogRec::Space(), XrdFrmConfig::Space(), ServerResponseHeader::status, strcat(), strcpy(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Mkdir | ( | XrdCnsLogRec * | lrP | ) | [private] |
Definition at line 446 of file XrdCnsLogClient.cc.
References Admin, XrdCnsLogRec::Lfn1(), XrdClientAdmin::Mkdir(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Mv | ( | XrdCnsLogRec * | lrP | ) | [private] |
Definition at line 457 of file XrdCnsLogClient.cc.
References Admin, XrdCnsLogRec::Lfn1(), XrdCnsLogRec::Lfn2(), XrdClientAdmin::Mv(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Rm | ( | XrdCnsLogRec * | lrP | ) | [private] |
Definition at line 468 of file XrdCnsLogClient.cc.
References Admin, XrdCnsLogRec::Lfn1(), XrdClientAdmin::Rm(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Rmdir | ( | XrdCnsLogRec * | lrP | ) | [private] |
Definition at line 478 of file XrdCnsLogClient.cc.
References Admin, XrdCnsLogRec::Lfn1(), XrdClientAdmin::Rmdir(), and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::do_Trunc | ( | XrdCnsLogRec * | lrP, | |
| const char * | lfn = 0 | |||
| ) | [private] |
Definition at line 488 of file XrdCnsLogClient.cc.
References Admin, XrdCnsLogRec::Lfn1(), XrdCnsLogRec::Size(), XrdClientAdmin::Truncate(), and xrdEmsg().
Referenced by Run().
| char XrdCnsLogClient::getMount | ( | char * | Lfn, | |
| char * | Pfn, | |||
| XrdCnsXref & | Mount | |||
| ) | [private] |
| int XrdCnsLogClient::Inventory | ( | XrdCnsLogFile * | lfp, | |
| const char * | dPath | |||
| ) | [private] |
Referenced by Manifest().
| int XrdCnsLogClient::Manifest | ( | ) | [private] |
Definition at line 499 of file XrdCnsLogClient.cc.
References Admin, arkFN, arkPath, XrdFrm::Config(), DEBUG, XrdSysError::Emsg(), XrdCnsLogFile::Eol(), ServerResponseBody_Error::errnum, XrdCnsLogFile::FName(), Inventory(), XrdCnsLog::invFNa, XrdCnsLog::invFNt, XrdCnsLog::invFNz, kXR_NotFound, XrdClientAbs::LastServerError(), lfMutex, XrdSysMutex::Lock(), logDir, logFirst, logFN, logLast, XrdCns::MLog, XrdCnsLogFile::Next, XrdOucTList::next, XrdCnsLogFile::Open(), rename, rindex, XrdClientAdmin::Stat(), strcpy(), XrdOucTList::text, TRACE, unlink, XrdSysMutex::UnLock(), V1, V2, V3, and xrdEmsg().
Referenced by Run().
| int XrdCnsLogClient::mapError | ( | int | rc | ) | [private] |
Definition at line 575 of file XrdCnsLogClient.cc.
References EHOSTUNREACH, ENOSYS, kXR_ArgTooLong, kXR_FSError, kXR_IOError, kXR_isDirectory, kXR_NoMemory, kXR_noserver, kXR_NoSpace, kXR_NotAuthorized, kXR_NotFile, and kXR_NotFound.
Referenced by xrdEmsg().
| int XrdCnsLogClient::xrdEmsg | ( | const char * | Opname, | |
| const char * | theFN, | |||
| XrdClientAdmin * | aP | |||
| ) | [private] |
Definition at line 596 of file XrdCnsLogClient.cc.
References XrdSysError::Emsg(), ServerResponseBody_Error::errmsg, ServerResponseBody_Error::errnum, XrdClientAbs::LastServerError(), mapError(), and XrdCns::MLog.
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] |
Definition at line 616 of file XrdCnsLogClient.cc.
References XrdSysError::Emsg(), ServerResponseBody_Error::errmsg, ServerResponseBody_Error::errnum, XrdClientAbs::LastServerError(), mapError(), and XrdCns::MLog.
XrdSysMutex XrdCnsLogClient::lfMutex [private] |
XrdSysSemaphore XrdCnsLogClient::lfSem [private] |
XrdCnsLogClient* XrdCnsLogClient::Next [private] |
Definition at line 61 of file XrdCnsLogClient.hh.
Referenced by Activate(), Start(), and XrdCnsLogClient().
XrdClientAdmin* XrdCnsLogClient::Admin [private] |
Definition at line 62 of file XrdCnsLogClient.hh.
Referenced by Archive(), do_Mkdir(), do_Mv(), do_Rm(), do_Rmdir(), do_Trunc(), Manifest(), Run(), XrdCnsLogClient(), and xrdEmsg().
XrdCnsLogFile* XrdCnsLogClient::logFirst [private] |
Definition at line 64 of file XrdCnsLogClient.hh.
Referenced by Activate(), Init(), Manifest(), Run(), and XrdCnsLogClient().
XrdCnsLogFile* XrdCnsLogClient::logLast [private] |
Definition at line 65 of file XrdCnsLogClient.hh.
Referenced by Activate(), Init(), Manifest(), Run(), and XrdCnsLogClient().
int XrdCnsLogClient::pfxNF [private] |
int XrdCnsLogClient::sfxFN [private] |
int XrdCnsLogClient::arkOnly [private] |
char* XrdCnsLogClient::admURL [private] |
Definition at line 71 of file XrdCnsLogClient.hh.
Referenced by admConnect(), and XrdCnsLogClient().
char* XrdCnsLogClient::urlHost [private] |
Definition at line 72 of file XrdCnsLogClient.hh.
Referenced by admConnect(), Init(), Run(), and XrdCnsLogClient().
char XrdCnsLogClient::arkURL[MAXPATHLEN+512] [private] |
Definition at line 74 of file XrdCnsLogClient.hh.
Referenced by Archive(), Run(), and XrdCnsLogClient().
char* XrdCnsLogClient::arkPath [private] |
Definition at line 75 of file XrdCnsLogClient.hh.
Referenced by Archive(), Manifest(), and XrdCnsLogClient().
char* XrdCnsLogClient::arkFN [private] |
Definition at line 76 of file XrdCnsLogClient.hh.
Referenced by Archive(), Manifest(), Run(), and XrdCnsLogClient().
char XrdCnsLogClient::crtURL[MAXPATHLEN+512] [private] |
char* XrdCnsLogClient::crtFN [private] |
char XrdCnsLogClient::logDir[MAXPATHLEN+1] [private] |
Definition at line 79 of file XrdCnsLogClient.hh.
Referenced by Activate(), Init(), Manifest(), and XrdCnsLogClient().
char* XrdCnsLogClient::logFN [private] |
Definition at line 80 of file XrdCnsLogClient.hh.
Referenced by Activate(), Init(), Manifest(), and XrdCnsLogClient().
1.5.1