xrootd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
XrdOfsCPFile Class Reference

#include <XrdOfsCPFile.hh>

Classes

class  rInfo
 

Public Member Functions

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)
 
 XrdOfsCPFile (const char *cfn=0)
 
 ~XrdOfsCPFile ()
 Destructor.
 

Static Public Member Functions

static char * Target (const char *ckpfn)
 

Static Private Member Functions

static char * genCkpPath ()
 
static int getSrcLfn (const char *cFN, rInfo &rinfo, int fd, int rc)
 

Private Attributes

char * ckpFN
 
int ckpFD
 
int ckpDLen
 
int ckpSize
 

Constructor & Destructor Documentation

◆ XrdOfsCPFile()

XrdOfsCPFile::XrdOfsCPFile ( const char *  cfn = 0)

Constructor

Parameters
cfn- Pointer to the name of the checkpoint file to use. When supplied, creates are prohibited.

◆ ~XrdOfsCPFile()

XrdOfsCPFile::~XrdOfsCPFile ( )

Destructor.

Member Function Documentation

◆ Append()

int XrdOfsCPFile::Append ( const char *  data,
off_t  offset,
int  dlen 
)

Append data to the checkpoint. Appends should be followed by Sync().

Parameters
data- Pointer to the data to be recorded.
offset- Offset in the source file where data came from.
dlen- Length of the data.
Returns
0 upon success and -errno upon failure.

◆ Create()

int XrdOfsCPFile::Create ( const char *  lfn,
struct stat Stat 
)

Create a checkpoint

Parameters
lfn- Pointer to the name of the source file being checkpointed.
Stat- Reference to source file stat information.
Returns
0 upon success and -errno upon failure.

◆ Destroy()

int XrdOfsCPFile::Destroy ( )

Destroy a checkpoint

Returns
0 upon success and -errno upon failure.

◆ ErrState()

int XrdOfsCPFile::ErrState ( )

Place checkpoint file in error state.

Returns
0 upon success and -errno upon failure.

◆ FName()

const char * XrdOfsCPFile::FName ( bool  trim = false)

Get the checkpoint file name.

Returns
pointer to the checkpoint file name. The pointer will be "???" if there is no checkpoint file established.

◆ genCkpPath()

static char * XrdOfsCPFile::genCkpPath ( )
staticprivate

◆ getSrcLfn()

static int XrdOfsCPFile::getSrcLfn ( const char *  cFN,
rInfo rinfo,
int  fd,
int  rc 
)
staticprivate

◆ isActive()

bool XrdOfsCPFile::isActive ( )
inline

Check if checpoint is established.

Returns
True if checkpoint has been established and false otherwise.

References ckpFN.

◆ Reserve()

bool XrdOfsCPFile::Reserve ( int  dlen,
int  nseg 
)

Reserve space for a subsequent checkpoint.

Parameters
dlen- the number of bytes that will be writen.
nseg- the number of segements that will be written.
Returns
True upon success and false otherwise

◆ RestoreInfo()

int XrdOfsCPFile::RestoreInfo ( rInfo rinfo,
const char *&  ewhy 
)

◆ Sync()

int XrdOfsCPFile::Sync ( )

Commit data to media.

Returns
0 upon success and -errno upon failure.

◆ Target()

static char * XrdOfsCPFile::Target ( const char *  ckpfn)
static

Get the name of the source file associated with a checkpoint file.

Parameters
ckpfn- Pointer to the name of the checkpoint file to use.
Returns
pointer to either the source file name or reason it's not valid.

◆ Used()

int XrdOfsCPFile::Used ( int  nseg = 0)

Get the curent size of the checkpoint file.

Parameters
nseg- the number of future segments to account for.
Returns
The size of the file in bytes.

Member Data Documentation

◆ ckpDLen

int XrdOfsCPFile::ckpDLen
private

◆ ckpFD

int XrdOfsCPFile::ckpFD
private

◆ ckpFN

char* XrdOfsCPFile::ckpFN
private

Referenced by isActive().

◆ ckpSize

int XrdOfsCPFile::ckpSize
private

The documentation for this class was generated from the following file: