XRootD
Loading...
Searching...
No Matches
XrdOssStats::File Class Reference

#include <XrdOssStatsFile.hh>

+ Inheritance diagram for XrdOssStats::File:
+ Collaboration diagram for XrdOssStats::File:

Public Member Functions

 File (std::unique_ptr< XrdOssDF > wrapDF, XrdSysError &log, FileSystem &oss)
 
virtual ~File ()
 
int Fchmod (mode_t mode) override
 
int Fstat (struct stat *buf) override
 
int Ftruncate (unsigned long long size) override
 
int Open (const char *path, int Oflag, mode_t Mode, XrdOucEnv &env) override
 
ssize_t pgRead (void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts) override
 
int pgRead (XrdSfsAio *aioparm, uint64_t opts) override
 
ssize_t pgWrite (void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts) override
 
int pgWrite (XrdSfsAio *aioparm, uint64_t opts) override
 
ssize_t Read (off_t offset, size_t size) override
 
ssize_t Read (void *buffer, off_t offset, size_t size) override
 
int Read (XrdSfsAio *aiop) override
 
ssize_t ReadRaw (void *buffer, off_t offset, size_t size) override
 
ssize_t ReadV (XrdOucIOVec *readV, int rdvcnt) override
 
ssize_t Write (const void *buffer, off_t offset, size_t size) override
 
int Write (XrdSfsAio *aiop) override
 
ssize_t WriteV (XrdOucIOVec *writeV, int wrvcnt) override
 
- Public Member Functions inherited from XrdOssWrapDF
 XrdOssWrapDF (XrdOssDF &df2Wrap)
 
virtual ~XrdOssWrapDF ()
 
virtual int Close (long long *retsz=0)
 
uint16_t DFType ()
 
virtual int Fctl (int cmd, int alen, const char *args, char **resp=0)
 
virtual void Flush ()
 Flush filesystem cached pages for this file (used for checksums).
 
virtual int Fsync ()
 
virtual int Fsync (XrdSfsAio *aiop)
 
virtual int getFD ()
 
virtual off_t getMmap (void **addr)
 
virtual const char * getTID ()
 
virtual int isCompressed (char *cxidp=0)
 
virtual int Opendir (const char *path, XrdOucEnv &env)
 
virtual int Readdir (char *buff, int blen)
 
virtual int StatRet (struct stat *Stat)
 
- Public Member Functions inherited from XrdOssDF
 XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1)
 
virtual ~XrdOssDF ()
 
uint16_t DFType ()
 

Additional Inherited Members

- Static Public Attributes inherited from XrdOssDF
static const uint16_t DF_isDir = 0x0001
 Object is for a directory.
 
static const uint16_t DF_isFile = 0x0002
 Object is for a file.
 
static const uint16_t DF_isProxy = 0x0010
 Object is a proxy object.
 
static const uint64_t doCalc = 0x4000000000000000ULL
 pgw: Calculate checksums
 
static const int Fctl_ckpObj = 0
 
static const int Fctl_utimes = 1
 
static const uint64_t Verify = 0x8000000000000000ULL
 all: Verify checksums
 
- Protected Attributes inherited from XrdOssWrapDF
XrdOssDFwrapDF
 
- Protected Attributes inherited from XrdOssDF
uint16_t dfType
 
int fd
 
off_t pgwEOF
 
short rsvd
 
const char * tident
 

Detailed Description

Definition at line 16 of file XrdOssStatsFile.hh.

Constructor & Destructor Documentation

◆ File()

XrdOssStats::File::File ( std::unique_ptr< XrdOssDF wrapDF,
XrdSysError log,
FileSystem oss 
)
inline

Definition at line 18 of file XrdOssStatsFile.hh.

18 :
20 m_wrapped(std::move(wrapDF)),
21 m_log(log),
22 m_oss(oss)
23 {}
XrdOssDF & wrapDF

◆ ~File()

File::~File ( )
virtual

Definition at line 6 of file XrdOssStatsFile.cc.

6{}

Member Function Documentation

◆ Fchmod()

int XrdOssStats::File::Fchmod ( mode_t  mode)
inlineoverridevirtual

Change file mode settings.

Parameters
mode- The new file mode setting.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 33 of file XrdOssStatsFile.hh.

34 {
35 FileSystem::OpTimer op(m_oss.m_ops.m_chmod_ops, m_oss.m_slow_ops.m_chmod_ops, m_oss.m_times.m_chmod, m_oss.m_slow_times.m_chmod, m_oss.m_slow_duration);
36 return wrapDF.Fchmod(mode);
37 }
virtual int Fchmod(mode_t mode)
Definition XrdOss.hh:120

References XrdOssDF::Fchmod(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Fstat()

int XrdOssStats::File::Fstat ( struct stat buf)
inlineoverridevirtual

Return state information for this file.

Parameters
buf- Pointer to the structure where info it to be returned.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 39 of file XrdOssStatsFile.hh.

40 {
41 FileSystem::OpTimer op(m_oss.m_ops.m_stat_ops, m_oss.m_slow_ops.m_stat_ops, m_oss.m_times.m_stat, m_oss.m_slow_times.m_stat, m_oss.m_slow_duration);
42 return wrapDF.Fstat(buf);
43 }
virtual int Fstat(struct stat *buf)
Definition XrdOss.hh:136

References XrdOssDF::Fstat(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Ftruncate()

int XrdOssStats::File::Ftruncate ( unsigned long long  flen)
inlineoverridevirtual

Set the size of the associated file.

Parameters
flen- The new size of the file.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 45 of file XrdOssStatsFile.hh.

46 {
47 FileSystem::OpTimer op(m_oss.m_ops.m_truncate_ops, m_oss.m_slow_ops.m_truncate_ops, m_oss.m_times.m_truncate, m_oss.m_slow_times.m_truncate, m_oss.m_slow_duration);
48 return wrapDF.Ftruncate(size);
49 }
virtual int Ftruncate(unsigned long long flen)
Definition XrdOss.hh:164

References XrdOssDF::Ftruncate(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Open()

int XrdOssStats::File::Open ( const char *  path,
int  Oflag,
mode_t  Mode,
XrdOucEnv env 
)
inlineoverridevirtual

Open a file.

Parameters
path- Pointer to the path of the file to be opened.
Oflag- Standard open flags.
Mode- File open mode (ignored unless creating a file).
env- Reference to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 27 of file XrdOssStatsFile.hh.

28 {
29 FileSystem::OpTimer op(m_oss.m_ops.m_open_ops, m_oss.m_slow_ops.m_open_ops, m_oss.m_times.m_open, m_oss.m_slow_times.m_open, m_oss.m_slow_duration);
30 return wrapDF.Open(path, Oflag, Mode, env);
31 }
int Mode
virtual int Open(const char *path, int Oflag, mode_t Mode, XrdOucEnv &env)
Definition XrdOss.hh:200

References Mode, XrdOssDF::Open(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ pgRead() [1/2]

ssize_t XrdOssStats::File::pgRead ( void *  buffer,
off_t  offset,
size_t  rdlen,
uint32_t *  csvec,
uint64_t  opts 
)
inlineoverridevirtual

Read file pages into a buffer and return corresponding checksums.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start. It must be page aligned.
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/XrdSys::PageSize + (rdlenXrdSys::PageSize != 0)
opts- Processing options (see below).
Returns
>= 0 The number of bytes that placed in buffer upon success.
< 0 -errno or -osserr upon failure. (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 51 of file XrdOssStatsFile.hh.

53 {
54 FileSystem::OpTimer op(m_oss.m_ops.m_pgread_ops, m_oss.m_slow_ops.m_pgread_ops, m_oss.m_times.m_pgread, m_oss.m_slow_times.m_pgread, m_oss.m_slow_duration);
55 return wrapDF.pgRead(buffer, offset, rdlen, csvec, opts);
56 }
struct myOpts opts
virtual ssize_t pgRead(void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts)
Definition XrdOss.cc:160

References opts, XrdOssDF::pgRead(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ pgRead() [2/2]

int XrdOssStats::File::pgRead ( XrdSfsAio aioparm,
uint64_t  opts 
)
inlineoverridevirtual

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
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 58 of file XrdOssStatsFile.hh.

59 {
60 FileSystem::OpTimer op(m_oss.m_ops.m_pgread_ops, m_oss.m_slow_ops.m_pgread_ops, m_oss.m_times.m_pgread, m_oss.m_slow_times.m_pgread, m_oss.m_slow_duration);
61 return wrapDF.pgRead(aioparm, opts);
62 }

References opts, XrdOssDF::pgRead(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ pgWrite() [1/2]

ssize_t XrdOssStats::File::pgWrite ( void *  buffer,
off_t  offset,
size_t  wrlen,
uint32_t *  csvec,
uint64_t  opts 
)
inlineoverridevirtual

Write file pages into a file with corresponding checksums.

Parameters
buffer- pointer to buffer containing the bytes to write.
offset- The offset where the write is to start. It must be page aligned.
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/XrdSys::PageSize + (wrlenXrdSys::PageSize != 0)
opts- Processing options (see above).
Returns
>= 0 The number of bytes written upon success. or -errno or -osserr upon failure. (see XrdOssError.hh).
< 0 -errno or -osserr upon failure. (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 64 of file XrdOssStatsFile.hh.

66 {
67 FileSystem::OpTimer op(m_oss.m_ops.m_pgwrite_ops, m_oss.m_slow_ops.m_pgwrite_ops, m_oss.m_times.m_pgwrite, m_oss.m_slow_times.m_pgwrite, m_oss.m_slow_duration);
68 return wrapDF.pgWrite(buffer, offset, wrlen, csvec, opts);
69 }
virtual ssize_t pgWrite(void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts)
Definition XrdOss.cc:198

References opts, XrdOssDF::pgWrite(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ pgWrite() [2/2]

int XrdOssStats::File::pgWrite ( XrdSfsAio aioparm,
uint64_t  opts 
)
inlineoverridevirtual

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
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 71 of file XrdOssStatsFile.hh.

72 {
73 FileSystem::OpTimer op(m_oss.m_ops.m_pgwrite_ops, m_oss.m_slow_ops.m_pgwrite_ops, m_oss.m_times.m_pgwrite, m_oss.m_slow_times.m_pgwrite, m_oss.m_slow_duration);
74 return wrapDF.pgWrite(aioparm, opts);
75 }

References opts, XrdOssDF::pgWrite(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Read() [1/3]

ssize_t XrdOssStats::File::Read ( off_t  offset,
size_t  size 
)
inlineoverridevirtual

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 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 77 of file XrdOssStatsFile.hh.

78 {
79 FileSystem::OpTimer op(m_oss.m_ops.m_read_ops, m_oss.m_slow_ops.m_read_ops, m_oss.m_times.m_read, m_oss.m_slow_times.m_read, m_oss.m_slow_duration);
80 return wrapDF.Read(offset, size);
81 }
virtual ssize_t Read(off_t offset, size_t size)
Definition XrdOss.hh:281

References XrdOssDF::Read(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Read() [2/3]

ssize_t XrdOssStats::File::Read ( void *  buffer,
off_t  offset,
size_t  size 
)
inlineoverridevirtual

Read file bytes into a buffer.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start.
size- The number of bytes to read.
Returns
>= 0 The number of bytes that placed in buffer.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 83 of file XrdOssStatsFile.hh.

84 {
85 FileSystem::OpTimer op(m_oss.m_ops.m_read_ops, m_oss.m_slow_ops.m_read_ops, m_oss.m_times.m_read, m_oss.m_slow_times.m_read, m_oss.m_slow_duration);
86 return wrapDF.Read(buffer, offset, size);
87 }

References XrdOssDF::Read(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Read() [3/3]

int XrdOssStats::File::Read ( XrdSfsAio aiop)
inlineoverridevirtual

Read file bytes using asynchronous I/O.

Parameters
aiop- Pointer to async I/O object controlling the I/O.
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 89 of file XrdOssStatsFile.hh.

90 {
91 FileSystem::OpTimer op(m_oss.m_ops.m_read_ops, m_oss.m_slow_ops.m_read_ops, m_oss.m_times.m_read, m_oss.m_slow_times.m_read, m_oss.m_slow_duration);
92 return wrapDF.Read(aiop);
93 }

References XrdOssDF::Read(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ ReadRaw()

ssize_t XrdOssStats::File::ReadRaw ( void *  buffer,
off_t  offset,
size_t  size 
)
inlineoverridevirtual

Read uncompressed file bytes into a buffer.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start.
size- The number of bytes to read.
Returns
>= 0 The number of bytes that placed in buffer.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 95 of file XrdOssStatsFile.hh.

96 {
97 FileSystem::OpTimer op(m_oss.m_ops.m_read_ops, m_oss.m_slow_ops.m_read_ops, m_oss.m_times.m_read, m_oss.m_slow_times.m_read, m_oss.m_slow_duration);
98 return wrapDF.ReadRaw(buffer, offset, size);
99 }
virtual ssize_t ReadRaw(void *buffer, off_t offset, size_t size)
Definition XrdOss.hh:319

References XrdOssDF::ReadRaw(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ ReadV()

ssize_t XrdOssStats::File::ReadV ( XrdOucIOVec readV,
int  rdvcnt 
)
inlineoverridevirtual

Read file bytes as directed by the read vector.

Parameters
readVpointer to the array of read requests.
rdvcntthe number of elements in readV.
Returns
>=0 The numbe of bytes read.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 101 of file XrdOssStatsFile.hh.

102 {
103 auto start = std::chrono::steady_clock::now();
104 auto result = wrapDF.ReadV(readV, rdvcnt);
105 auto dur = std::chrono::steady_clock::now() - start;
106 m_oss.m_ops.m_readv_ops++;
107 m_oss.m_ops.m_readv_segs += rdvcnt;
108 auto ns = std::chrono::nanoseconds(dur).count();
109 m_oss.m_times.m_readv += ns;
110 if (dur > m_oss.m_slow_duration) {
111 m_oss.m_slow_ops.m_readv_ops++;
112 m_oss.m_slow_ops.m_readv_segs += rdvcnt;
113 m_oss.m_times.m_readv += std::chrono::nanoseconds(dur).count();
114 }
115 return result;
116 }
virtual ssize_t ReadV(XrdOucIOVec *readV, int rdvcnt)
Definition XrdOss.cc:236

References XrdOssDF::ReadV(), and XrdOssWrapDF::wrapDF.

+ Here is the call graph for this function:

◆ Write() [1/2]

ssize_t XrdOssStats::File::Write ( const void *  buffer,
off_t  offset,
size_t  size 
)
inlineoverridevirtual

Write file bytes from a buffer.

Parameters
buffer- pointer to buffer where the bytes reside.
offset- The offset where the write is to start.
size- The number of bytes to write.
Returns
>= 0 The number of bytes that were written.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 118 of file XrdOssStatsFile.hh.

119 {
120 FileSystem::OpTimer op(m_oss.m_ops.m_write_ops, m_oss.m_slow_ops.m_write_ops, m_oss.m_times.m_write, m_oss.m_slow_times.m_write, m_oss.m_slow_duration);
121 return wrapDF.Write(buffer, offset, size);
122 }
virtual ssize_t Write(const void *buffer, off_t offset, size_t size)
Definition XrdOss.hh:345

References XrdOssWrapDF::wrapDF, and XrdOssDF::Write().

+ Here is the call graph for this function:

◆ Write() [2/2]

int XrdOssStats::File::Write ( XrdSfsAio aiop)
inlineoverridevirtual

Write file bytes using asynchronous I/O.

Parameters
aiop- Pointer to async I/O object controlling the I/O.
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 124 of file XrdOssStatsFile.hh.

125 {
126 FileSystem::OpTimer op(m_oss.m_ops.m_write_ops, m_oss.m_slow_ops.m_write_ops, m_oss.m_times.m_write, m_oss.m_slow_times.m_write, m_oss.m_slow_duration);
127 return wrapDF.Write(aiop);
128 }

References XrdOssWrapDF::wrapDF, and XrdOssDF::Write().

+ Here is the call graph for this function:

◆ WriteV()

ssize_t XrdOssStats::File::WriteV ( XrdOucIOVec writeV,
int  wrvcnt 
)
inlineoverridevirtual

Write file bytes as directed by the write vector.

Parameters
writeVpointer to the array of write requests.
wrvcntthe number of elements in writeV.
Returns
>=0 The numbe of bytes read.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented from XrdOssWrapDF.

Definition at line 130 of file XrdOssStatsFile.hh.

131 {
132 FileSystem::OpTimer op(m_oss.m_ops.m_write_ops, m_oss.m_slow_ops.m_write_ops, m_oss.m_times.m_write, m_oss.m_slow_times.m_write, m_oss.m_slow_duration);
133 return wrapDF.WriteV(writeV, wrvcnt);
134 }
virtual ssize_t WriteV(XrdOucIOVec *writeV, int wrvcnt)
Definition XrdOss.cc:257

References XrdOssWrapDF::wrapDF, and XrdOssDF::WriteV().

+ Here is the call graph for this function:

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