![]() |
XRootD
|
#include <XrdOfsCPFile.hh>
Classes | |
class | rInfo |
Public Member Functions | |
XrdOfsCPFile (const char *cfn=0) | |
~XrdOfsCPFile () | |
Destructor. More... | |
int | Append (const char *data, off_t offset, int dlen) |
int | Create (const char *lfn, struct stat &Stat) |
int | Destroy () |
int | ErrState () |
const char * | FName (bool trim=false) |
bool | isActive () |
bool | Reserve (int dlen, int nseg) |
int | RestoreInfo (rInfo &rinfo, const char *&ewhy) |
int | Sync () |
int | Used (int nseg=0) |
Static Public Member Functions | |
static char * | Target (const char *ckpfn) |
Definition at line 39 of file XrdOfsCPFile.hh.
XrdOfsCPFile::XrdOfsCPFile | ( | const char * | cfn = 0 | ) |
Constructor
cfn | - Pointer to the name of the checkpoint file to use. When supplied, creates are prohibited. |
Definition at line 136 of file XrdOfsCPFile.cc.
XrdOfsCPFile::~XrdOfsCPFile | ( | ) |
int XrdOfsCPFile::Append | ( | const char * | data, |
off_t | offset, | ||
int | dlen | ||
) |
Append data to the checkpoint. Appends should be followed by Sync().
data | - Pointer to the data to be recorded. |
offset | - Offset in the source file where data came from. |
dlen | - Length of the data. |
Definition at line 157 of file XrdOfsCPFile.cc.
References XrdOucCRC::Calc32C(), and writev().
Referenced by XrdOfsChkPnt::Truncate(), and XrdOfsChkPnt::Write().
int XrdOfsCPFile::Create | ( | const char * | lfn, |
struct stat & | Stat | ||
) |
Create a checkpoint
lfn | - Pointer to the name of the source file being checkpointed. |
Stat | - Reference to source file stat information. |
Definition at line 199 of file XrdOfsCPFile.cc.
References XrdOucCRC::Calc32C(), close, fsync(), ftruncate(), Stat, unlink(), writev(), and XATTR.
Referenced by XrdOfsChkPnt::Create().
int XrdOfsCPFile::Destroy | ( | ) |
Destroy a checkpoint
Definition at line 264 of file XrdOfsCPFile.cc.
References ErrState(), truncate(), and unlink().
Referenced by XrdOfsChkPnt::Delete().
int XrdOfsCPFile::ErrState | ( | ) |
Place checkpoint file in error state.
Definition at line 284 of file XrdOfsCPFile.cc.
References rename().
Referenced by Destroy().
const char * XrdOfsCPFile::FName | ( | bool | trim = false | ) |
Get the checkpoint file name.
Definition at line 300 of file XrdOfsCPFile.cc.
References trim().
Referenced by XrdOfsChkPnt::Create(), XrdOfsChkPnt::Delete(), and XrdOfsChkPnt::Restore().
|
inline |
Check if checpoint is established.
Definition at line 97 of file XrdOfsCPFile.hh.
Referenced by XrdOfsChkPnt::Create(), XrdOfsChkPnt::Delete(), XrdOfsChkPnt::Restore(), XrdOfsChkPnt::Truncate(), and XrdOfsChkPnt::Write().
bool XrdOfsCPFile::Reserve | ( | int | dlen, |
int | nseg | ||
) |
Reserve space for a subsequent checkpoint.
dlen | - the number of bytes that will be writen. |
nseg | - the number of segements that will be written. |
Definition at line 353 of file XrdOfsCPFile.cc.
References fcntl(), and ftruncate().
Referenced by XrdOfsChkPnt::Truncate(), and XrdOfsChkPnt::Write().
int XrdOfsCPFile::RestoreInfo | ( | XrdOfsCPFile::rInfo & | rinfo, |
const char *& | ewhy | ||
) |
Definition at line 385 of file XrdOfsCPFile.cc.
References XrdOfsCPFile::rInfo::DataLen, XrdOfsCPFile::rInfo::DataNum, XrdOfsCPFile::rInfo::DataVec, ENODATA, XrdOfsCPFile::rInfo::fSize, fstat(), XrdOfsCPFile::rInfo::mTime, read(), XrdOucIOVec::size, XrdOfsCPFile::rInfo::srcLFN, Stat, stat(), and XrdOucCRC::Ver32C().
Referenced by XrdOfsChkPnt::Restore().
int XrdOfsCPFile::Sync | ( | ) |
Commit data to media.
Definition at line 520 of file XrdOfsCPFile.cc.
References fsync().
Referenced by XrdOfsChkPnt::Truncate(), and XrdOfsChkPnt::Write().
|
static |
Get the name of the source file associated with a checkpoint file.
ckpfn | - Pointer to the name of the checkpoint file to use. |
Definition at line 530 of file XrdOfsCPFile.cc.
References eMsg, read(), XATTR, and XrdSysE2T().
int XrdOfsCPFile::Used | ( | int | nseg = 0 | ) |
Get the curent size of the checkpoint file.
nseg | - the number of future segments to account for. |
Definition at line 572 of file XrdOfsCPFile.cc.