XrdSfsFile Class Reference

#include <XrdSfsInterface.hh>

Inheritance diagram for XrdSfsFile:
Inheritance graph
[legend]
Collaboration diagram for XrdSfsFile:
Collaboration graph
[legend]

List of all members.

Public Types

enum  cpAct { cpCreate = 0, cpDelete, cpRestore }

Public Member Functions

virtual int open (const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)=0
virtual int checkpoint (cpAct act, struct iov *range=0, int n=0)
virtual int close ()=0
virtual int fctl (const int cmd, const char *args, XrdOucErrInfo &eInfo)=0
virtual int fctl (const int cmd, int alen, const char *args, const XrdSecEntity *client=0)
virtual const char * FName ()=0
virtual int getMmap (void **Addr, off_t &Size)=0
virtual XrdSfsXferSize pgRead (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0)
virtual int pgRead (XrdSfsAio *aioparm, uint64_t opts=0)
virtual XrdSfsXferSize pgWrite (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0)
virtual int pgWrite (XrdSfsAio *aioparm, uint64_t opts=0)
virtual XrdSfsXferSize read (XrdSfsFileOffset offset, XrdSfsXferSize size)=0
virtual XrdSfsXferSize read (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize size)=0
virtual int read (XrdSfsAio *aioparm)=0
virtual XrdSfsXferSize readv (XrdOucIOVec *readV, int rdvCnt)
virtual int SendData (XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size)
virtual XrdSfsXferSize write (XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0
virtual int write (XrdSfsAio *aioparm)=0
virtual XrdSfsXferSize writev (XrdOucIOVec *writeV, int wdvCnt)
virtual int stat (struct stat *buf)=0
virtual int sync ()=0
virtual int sync (XrdSfsAio *aiop)=0
virtual int truncate (XrdSfsFileOffset fsize)=0
virtual int getCXinfo (char cxtype[4], int &cxrsz)=0
virtual void setXio (XrdSfsXio *xioP)
 XrdSfsFile (const char *user=0, int MonID=0)
 XrdSfsFile (XrdSfsFile &wrapF)
 XrdSfsFile (XrdOucErrInfo &eInfo)
virtual ~XrdSfsFile ()
 Destructor.

Public Attributes

XrdOucErrInfoerror

Static Public Attributes

static const uint64_t Verify = 0x8000000000000000ULL
 Options for pgRead() and pgWrite() as noted below.
static const uint64_t NetOrder = 0x4000000000000000ULL
 all: bytes in/out in net byte order

Private Attributes

XrdOucErrInfolclEI
XrdSfsFileOffset pgwrEOF

Member Enumeration Documentation

Create, delete, query, or rollback a file checkpoint.

Parameters:
act - The operation to be performed (see cpAct enum below).
range - Portions of the file to be checkpointed.
n - Number of elements in range.
Returns:
One of SFS_OK or SFS_ERROR.
Enumerator:
cpCreate 

Create a checkpoint, one must not be active.

cpDelete 

Delete an existing checkpoint.

cpRestore 

Restore an active checkpoint and delete it.


Constructor & Destructor Documentation

XrdSfsFile::XrdSfsFile ( const char *  user = 0,
int  MonID = 0 
) [inline]

Constructor (user and MonID are the ones passed to newFile()!). This constructor should only be used by base plugins. Plugins that wrap an SfsFile should use the second version of the constructor shown below.

Parameters:
user - Text identifying the client responsible for this call. The pointer may be null if identification is missing.
MonID - The monitoring identifier assigned to this and all future requests using the returned object.

References error, lclEI, and pgwrEOF.

XrdSfsFile::XrdSfsFile ( XrdSfsFile wrapF  )  [inline]

Constructor for plugins that wrap another SFS plugin. This constructor inherits the error object from a wrapped XrdSfsFile object so that only one identical error object exists for all file objects in the chain.

Parameters:
wrapF - Reference to the file object being wrapped.
XrdSfsFile::XrdSfsFile ( XrdOucErrInfo eInfo  )  [inline]

Constructor for base plugins that predefined an error object. This is a convenience constructor for base plugins only.

Parameters:
eInfo - Reference to the error object to use.
virtual XrdSfsFile::~XrdSfsFile (  )  [inline, virtual]

Destructor.

References lclEI.


Member Function Documentation

virtual int XrdSfsFile::checkpoint ( cpAct  act,
struct iov *  range = 0,
int  n = 0 
) [virtual]

Reimplemented in XrdThrottle::File.

virtual int XrdSfsFile::close (  )  [pure virtual]

Close the file.

Returns:
One of SFS_OK or SFS_ERROR.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::fctl ( const int  cmd,
int  alen,
const char *  args,
const XrdSecEntity client = 0 
) [virtual]

Execute a special operation on the file (version 2)

Parameters:
cmd - The operation to be performed: SFS_FCTL_SPEC1 Perform implementation defined action
alen - Length of data pointed to by args.
args - Data sent with request, zero if alen is zero.
client - Client's identify (see common description).
Returns:
SFS_OK a null response is sent.
SFS_DATA error.code length of the data to be sent. error.message contains the data to be sent. o/w one of SFS_ERROR, SFS_REDIRECT, or SFS_STALL.

Reimplemented in XrdOfsFile, and XrdSsiFile.

virtual int XrdSfsFile::fctl ( const int  cmd,
const char *  args,
XrdOucErrInfo eInfo 
) [pure virtual]

Execute a special operation on the file (version 1)

Parameters:
cmd - The operation to be performed (see below). SFS_FCTL_GETFD Return file descriptor if possible SFS_FCTL_STATV Reserved for future use.
args - specific arguments to cmd SFS_FCTL_GETFD Set to zero.
eInfo - The object where error info or results are to be returned. This is legacy and the error onject may be used as well.
Returns:
If an error occurs or the operation is not support, SFS_ERROR should be returned with error.code set to errno. Otherwise, SFS_FCTL_GETFD error.code holds the real file descriptor number If the value is negative, sendfile() is not used. If the value is SFS_SFIO_FDVAL then the SendData() method is used for future read requests.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual const char* XrdSfsFile::FName (  )  [pure virtual]

Get the file path.

Returns:
Null terminated string of the path used in open().

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::getCXinfo ( char  cxtype[4],
int &  cxrsz 
) [pure virtual]

Get compression information for the file.

Parameters:
cxtype - Place where the compression algorithm name is to be placed
cxrsz - Place where the compression page size is to be returned
Returns:
One of the valid SFS return codes described above. If the file is not compressed or an error is returned, cxrsz must be set to 0.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::getMmap ( void **  Addr,
off_t &  Size 
) [pure virtual]

Get file's memory mapping if one exists (memory mapped files only).

Parameters:
addr - Place where the starting memory address is returned.
size - Place where the file's size is returned.
Returns:
SFS_OK when the file is memory mapped or any other code otherwise.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::open ( const char *  fileName,
XrdSfsFileOpenMode  openMode,
mode_t  createMode,
const XrdSecEntity client = 0,
const char *  opaque = 0 
) [pure virtual]

Open a file.

Parameters:
path - Pointer to the path of the file to be opened.
oMode - Flags indicating how the open is to be handled. SFS_O_CREAT create the file SFS_O_MKPTH Make directory path if missing SFS_O_NOWAIT do not impose operational delays SFS_O_NOTPC do not allow TPC operation SFS_O_POSC persist only on successful close SFS_O_RAWIO allow client-side decompression SFS_O_RDONLY open read/only SFS_O_RDWR open read/write SFS_O_REPLICA Open for replication SFS_O_RESET Reset any cached information SFS_O_TRUNC truncate existing file to zero length SFS_O_WRONLY open write/only
cMode - The file's mode if it will be created.
client - Client's identify (see common description).
opaque - path's CGI information (see common description).
Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, SFS_STALL, or SFS_STARTED

Implemented in XrdBwmFile, XrdOfsFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::pgRead ( XrdSfsAio aioparm,
uint64_t  opts = 0 
) [virtual]

Read file pages and checksums using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
opts - Processing options (see above).
Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented in XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::pgRead ( XrdSfsFileOffset  offset,
char *  buffer,
XrdSfsXferSize  rdlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [virtual]

Read file pages into a buffer and return corresponding checksums.

Parameters:
offset - The offset where the read is to start. It must be page aligned.
buffer - pointer to buffer where the bytes are to be placed.
rdlen - The number of bytes to read. The amount must be an integral number of XrdSfsPage::Size bytes.
csvec - A vector of entries to be filled with the cooresponding CRC32C checksum for each page. It must be size to rdlen/XrdSysPageSize + (rdlenXrdSysPageSize != 0)
opts - Processing options (see above).
Returns:
>= 0 The number of bytes that placed in buffer.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented in XrdThrottle::File.

virtual int XrdSfsFile::pgWrite ( XrdSfsAio aioparm,
uint64_t  opts = 0 
) [virtual]

Write file pages and checksums using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
opts - Processing options (see above).
Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented in XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::pgWrite ( XrdSfsFileOffset  offset,
char *  buffer,
XrdSfsXferSize  wrlen,
uint32_t *  csvec,
uint64_t  opts = 0 
) [virtual]

Write file pages into a file with corresponding checksums.

Parameters:
offset - The offset where the write is to start. It must be page aligned.
buffer - pointer to buffer containing the bytes to write.
wrlen - The number of bytes to write. If amount is not an integral number of XrdSys::PageSize bytes, then this must be the last write to the file at or above the offset.
csvec - A vector which contains the corresponding CRC32 checksum for each page. It must be size to wrlen/XrdSysPageSize + (wrlenXrdSysPageSize != 0)
opts - Processing options (see above).
Returns:
>= 0 The number of bytes written.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented in XrdThrottle::File.

virtual int XrdSfsFile::read ( XrdSfsAio aioparm  )  [pure virtual]

Read file bytes using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::read ( XrdSfsFileOffset  offset,
char *  buffer,
XrdSfsXferSize  size 
) [pure virtual]

Read file bytes into a buffer.

Parameters:
offset - The offset where the read is to start.
buffer - pointer to buffer where the bytes are to be placed.
size - The number of bytes to read.
Returns:
>= 0 The number of bytes that placed in buffer.
SFS_ERROR File could not be read, error holds the reason.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::read ( XrdSfsFileOffset  offset,
XrdSfsXferSize  size 
) [pure virtual]

Preread file blocks into the file system cache.

Parameters:
offset - The offset where the read is to start.
size - The number of bytes to pre-read.
Returns:
>= 0 The number of bytes that will be pre-read.
SFS_ERROR File could not be preread, error holds the reason.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::readv ( XrdOucIOVec readV,
int  rdvCnt 
) [virtual]

Given an array of read requests (size rdvCnt), read them from the file and place the contents consecutively in the provided buffer. A dumb default implementation is supplied but should be replaced to increase performance.

Parameters:
readV pointer to the array of read requests.
rdvcnt the number of elements in readV.
Returns:
>=0 The numbe of bytes placed into the buffer.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented in XrdDigFile, XrdOfsFile, XrdSfsNativeFile, and XrdSsiFile.

virtual int XrdSfsFile::SendData ( XrdSfsDio sfDio,
XrdSfsFileOffset  offset,
XrdSfsXferSize  size 
) [virtual]

Send file bytes via a XrdSfsDio sendfile object to a client (optional).

Parameters:
sfDio - Pointer to the sendfile object for data transfer.
offset - The offset where the read is to start.
size - The number of bytes to read and send.
Returns:
SFS_ERROR File not read, error object has reason.
SFS_OK Either data has been successfully sent via sfDio or no data has been sent and a normal read() should be issued.

Reimplemented in XrdSsiFile, and XrdThrottle::File.

virtual void XrdSfsFile::setXio ( XrdSfsXio xioP  )  [inline, virtual]

Enable exchange buffer I/O for write calls.

Parameters:
- Pointer to the XrdSfsXio object to be used for buffer exchanges.

Reimplemented in XrdSsiFile.

virtual int XrdSfsFile::stat ( struct stat *  buf  )  [pure virtual]

Return state information on the file.

Parameters:
buf - Pointer to the structure where info it to be returned.
Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL. When SFS_OK is returned, buf must hold stat information.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::sync ( XrdSfsAio aiop  )  [pure virtual]

Make sure all outstanding data is actually written to the file (async).

Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR Request could not be accepted, return error has reason.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::sync (  )  [pure virtual]

Make sure all outstanding data is actually written to the file (sync).

Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, SFS_STALL, or SFS_STARTED

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::truncate ( XrdSfsFileOffset  fsize  )  [pure virtual]

Truncate the file.

Parameters:
fsize - The size that the file is to have.
Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual int XrdSfsFile::write ( XrdSfsAio aioparm  )  [pure virtual]

Write file bytes using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
Returns:
0 Request accepted and will be scheduled.
!0 Request not accepted, returned value is errno.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::write ( XrdSfsFileOffset  offset,
const char *  buffer,
XrdSfsXferSize  size 
) [pure virtual]

Write file bytes from a buffer.

Parameters:
offset - The offset where the write is to start.
buffer - pointer to buffer where the bytes reside.
size - The number of bytes to write.
Returns:
>= 0 The number of bytes that were written.
SFS_ERROR File could not be written, error holds the reason.

Implemented in XrdBwmFile, XrdDigFile, XrdOfsFile, XrdSfsNativeFile, XrdSsiFile, and XrdThrottle::File.

virtual XrdSfsXferSize XrdSfsFile::writev ( XrdOucIOVec writeV,
int  wdvCnt 
) [virtual]

Given an array of write requests (size wdvcnt), write them to the file from the provided associated buffer. A dumb default implementation is supplied but should be replaced to increase performance.

Parameters:
writeV pointer to the array of write requests.
wdvcnt the number of elements in writeV.
Returns:
>=0 The total number of bytes written to the file.
SFS_ERROR File could not be written, error holds the reason.

Member Data Documentation

The error object is used to return details whenever something other than SFS_OK is returned from the methods in this class, when noted.

Referenced by XrdSfsFile().

Referenced by XrdSfsFile(), and ~XrdSfsFile().

const uint64_t XrdSfsFile::NetOrder = 0x4000000000000000ULL [static]

all: bytes in/out in net byte order

Referenced by XrdSfsFile().

const uint64_t XrdSfsFile::Verify = 0x8000000000000000ULL [static]

Options for pgRead() and pgWrite() as noted below.

all: Verify checksums


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1