#include <XrdOfsCPFile.hh>
Classes | |
| class | rInfo |
Public Member Functions | |
| XrdOfsCPFile (const char *cfn=0) | |
| ~XrdOfsCPFile () | |
| Destructor. | |
| 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 | ( | ) |
Destructor.
Definition at line 144 of file XrdOfsCPFile.cc.
References close.
| 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.
| 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, stat, unlink, writev, and XATTR.
| int XrdOfsCPFile::Destroy | ( | ) |
Destroy a checkpoint
Definition at line 264 of file XrdOfsCPFile.cc.
References ErrState(), truncate, and unlink.
| 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().
|
inline |
Check if checpoint is established.
Definition at line 97 of file XrdOfsCPFile.hh.
| 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 ftruncate.
| 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, XrdOfsCPFile::rInfo::srcLFN, Stat, stat, and XrdOucCRC::Ver32C().
| int XrdOfsCPFile::Sync | ( | ) |
Commit data to media.
Definition at line 520 of file XrdOfsCPFile.cc.
References fsync.
|
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.