![]() |
XRootD
|
#include <XrdCephOssBufferedFile.hh>
Public Member Functions | |
XrdCephOssBufferedFile (XrdCephOss *cephoss, XrdCephOssFile *cephossDF, size_t buffersize, const std::string &bufferIOmode, size_t maxNumberSimulBuffers) | |
virtual | ~XrdCephOssBufferedFile () |
virtual int | Close (long long *retsz=0) |
virtual int | Fstat (struct stat *buff) |
virtual int | Fsync (void) |
virtual int | Ftruncate (unsigned long long) |
virtual int | Open (const char *path, int flags, mode_t mode, XrdOucEnv &env) |
virtual ssize_t | Read (off_t offset, size_t blen) |
virtual ssize_t | Read (void *buff, off_t offset, size_t blen) |
virtual int | Read (XrdSfsAio *aoip) |
virtual ssize_t | ReadRaw (void *, off_t, size_t) |
virtual ssize_t | ReadV (XrdOucIOVec *readV, int rdvcnt) |
virtual ssize_t | Write (const void *buff, off_t offset, size_t blen) |
virtual int | Write (XrdSfsAio *aiop) |
![]() | |
XrdCephOssFile (XrdCephOss *cephoss) | |
virtual | ~XrdCephOssFile () |
virtual int | getFileDescriptor () const |
![]() | |
XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1) | |
virtual | ~XrdOssDF () |
uint16_t | DFType () |
virtual int | Fchmod (mode_t mode) |
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). More... | |
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 ssize_t | pgRead (void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts) |
virtual int | pgRead (XrdSfsAio *aioparm, uint64_t opts) |
virtual ssize_t | pgWrite (void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts) |
virtual int | pgWrite (XrdSfsAio *aioparm, uint64_t opts) |
virtual int | Readdir (char *buff, int blen) |
virtual int | StatRet (struct stat *buff) |
virtual ssize_t | WriteV (XrdOucIOVec *writeV, int wrvcnt) |
Protected Member Functions | |
std::unique_ptr< XrdCephBuffer::IXrdCephBufferAlg > | createBuffer () |
Protected Attributes | |
std::mutex | m_buf_mutex |
std::unique_ptr< XrdCephBuffer::IXrdCephBufferAlg > | m_bufferAlg |
std::string | m_bufferIOmode |
std::map< size_t, std::unique_ptr< XrdCephBuffer::IXrdCephBufferAlg > > | m_bufferReadAlgs |
size_t | m_bufsize = 16*1024*1024L |
std::atomic< size_t > | m_bytesRead = {0} |
std::atomic< size_t > | m_bytesReadAIO = {0} |
number of bytes read or written More... | |
std::atomic< size_t > | m_bytesReadV = {0} |
number of bytes read or written More... | |
std::atomic< size_t > | m_bytesWrite = {0} |
number of bytes read or written More... | |
std::atomic< size_t > | m_bytesWriteAIO = {0} |
number of bytes read or written More... | |
XrdCephOss * | m_cephoss = nullptr |
create a new instance of the buffer More... | |
int | m_flags = 0 |
number of ms to sleep if a retry is requested More... | |
int | m_maxBufferRetries {5} |
set the maximum of buffers to open on a single instance (e.g. for simultaneous file reads) More... | |
int | m_maxBufferRetrySleepTime_ms |
How many times to retry a ready from a buffer with EBUSY errors. More... | |
size_t | m_maxCountReadBuffers {10} |
any data access method on the buffer will use this More... | |
std::string | m_path |
std::chrono::time_point< std::chrono::system_clock > | m_timestart |
XrdCephOssFile * | m_xrdOssDF = nullptr |
![]() | |
XrdCephOss * | m_cephOss |
int | m_fd |
![]() | |
uint16_t | dfType |
int | fd |
off_t | pgwEOF |
short | rsvd |
const char * | tident |
Additional Inherited Members | |
![]() | |
static const uint16_t | DF_isDir = 0x0001 |
Object is for a directory. More... | |
static const uint16_t | DF_isFile = 0x0002 |
Object is for a file. More... | |
static const uint16_t | DF_isProxy = 0x0010 |
Object is a proxy object. More... | |
static const uint64_t | doCalc = 0x4000000000000000ULL |
pgw: Calculate checksums More... | |
static const int | Fctl_ckpObj = 0 |
static const int | Fctl_utimes = 1 |
static const uint64_t | Verify = 0x8000000000000000ULL |
all: Verify checksums More... | |
Decorator class XrdCephOssBufferedFile designed to wrap XrdCephOssFile Functionality for buffered access to/from data in Ceph to avoid inefficient small reads / writes from the client side
Definition at line 48 of file XrdCephOssBufferedFile.hh.
XrdCephOssBufferedFile::XrdCephOssBufferedFile | ( | XrdCephOss * | cephoss, |
XrdCephOssFile * | cephossDF, | ||
size_t | buffersize, | ||
const std::string & | bufferIOmode, | ||
size_t | maxNumberSimulBuffers | ||
) |
Definition at line 58 of file XrdCephOssBufferedFile.cc.
|
virtual |
|
virtual |
Close a directory or file.
retsz | If not nil, where the size of the file is to be returned. |
Reimplemented from XrdCephOssFile.
Definition at line 101 of file XrdCephOssBufferedFile.cc.
References XrdCephOssFile::Close(), LOGCEPH, m_bufferAlg, m_bufferReadAlgs, m_bytesRead, m_bytesReadAIO, m_bytesReadV, m_bytesWrite, m_bytesWriteAIO, XrdCephOssFile::m_fd, m_flags, m_path, m_timestart, and m_xrdOssDF.
|
protected |
Definition at line 313 of file XrdCephOssBufferedFile.cc.
References BUFLOG, XrdCephOssFile::Close(), LOGCEPH, m_bufferIOmode, m_bufferReadAlgs, m_bufsize, m_cephoss, XrdCephOssFile::m_fd, m_maxCountReadBuffers, XrdCephOss::m_useDefaultPreadAlg, and m_xrdOssDF.
Referenced by Read(), and Write().
|
virtual |
Return state information for this file.
buf | - Pointer to the structure where info it to be returned. |
Reimplemented from XrdCephOssFile.
Definition at line 240 of file XrdCephOssBufferedFile.cc.
References XrdCephOssFile::Fstat(), and m_xrdOssDF.
|
virtual |
Synchronize associated file with media (synchronous).
Reimplemented from XrdCephOssFile.
Definition at line 304 of file XrdCephOssBufferedFile.cc.
References XrdCephOssFile::Fsync(), and m_xrdOssDF.
|
virtual |
Set the size of the associated file.
flen | - The new size of the file. |
Reimplemented from XrdCephOssFile.
Definition at line 308 of file XrdCephOssBufferedFile.cc.
References XrdCephOssFile::Ftruncate(), and m_xrdOssDF.
|
virtual |
Open a file.
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. |
Reimplemented from XrdCephOssFile.
Definition at line 82 of file XrdCephOssBufferedFile.cc.
References BUFLOG, XrdCephOssFile::getFileDescriptor(), XrdCephOssFile::m_fd, m_flags, m_path, m_timestart, m_xrdOssDF, and XrdCephOssFile::Open().
|
virtual |
Preread file blocks into the file system cache.
offset | - The offset where the read is to start. |
size | - The number of bytes to pre-read. |
Reimplemented from XrdCephOssFile.
Definition at line 147 of file XrdCephOssBufferedFile.cc.
References m_xrdOssDF, and XrdCephOssFile::Read().
|
virtual |
Read file bytes into a buffer.
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. |
Reimplemented from XrdCephOssFile.
Definition at line 151 of file XrdCephOssBufferedFile.cc.
References createBuffer(), LOGCEPH, m_buf_mutex, m_bufferReadAlgs, m_bytesRead, XrdCephOssFile::m_fd, m_maxBufferRetries, m_maxBufferRetrySleepTime_ms, m_xrdOssDF, and XrdCephOssFile::Read().
|
virtual |
Read file bytes using asynchronous I/O.
aiop | - Pointer to async I/O object controlling the I/O. |
Reimplemented from XrdCephOssFile.
Definition at line 205 of file XrdCephOssBufferedFile.cc.
References aiocb::aio_nbytes, aiocb::aio_offset, createBuffer(), LOGCEPH, m_buf_mutex, m_bufferReadAlgs, m_bytesReadAIO, XrdCephOssFile::m_fd, and XrdSfsAio::sfsAio.
|
virtual |
Read uncompressed file bytes into a buffer.
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. |
Reimplemented from XrdCephOssFile.
Definition at line 235 of file XrdCephOssBufferedFile.cc.
References m_xrdOssDF, and XrdCephOssFile::ReadRaw().
|
virtual |
Read file bytes as directed by the read vector.
readV | pointer to the array of read requests. |
rdvcnt | the number of elements in readV. |
Reimplemented from XrdCephOssFile.
Definition at line 140 of file XrdCephOssBufferedFile.cc.
References m_bytesReadV, m_xrdOssDF, and XrdCephOssFile::ReadV().
|
virtual |
Write file bytes from a buffer.
buffer | - pointer to buffer where the bytes reside. |
offset | - The offset where the write is to start. |
size | - The number of bytes to write. |
Reimplemented from XrdCephOssFile.
Definition at line 244 of file XrdCephOssBufferedFile.cc.
References createBuffer(), LOGCEPH, m_bufferAlg, m_bytesWrite, XrdCephOssFile::m_fd, m_maxBufferRetries, and m_maxBufferRetrySleepTime_ms.
|
virtual |
Write file bytes using asynchronous I/O.
aiop | - Pointer to async I/O object controlling the I/O. |
Reimplemented from XrdCephOssFile.
Definition at line 280 of file XrdCephOssBufferedFile.cc.
References aiocb::aio_nbytes, aiocb::aio_offset, createBuffer(), LOGCEPH, m_bufferAlg, m_bytesWriteAIO, XrdCephOssFile::m_fd, and XrdSfsAio::sfsAio.
|
protected |
Definition at line 76 of file XrdCephOssBufferedFile.hh.
Referenced by Read().
|
protected |
Definition at line 74 of file XrdCephOssBufferedFile.hh.
|
protected |
Definition at line 85 of file XrdCephOssBufferedFile.hh.
Referenced by createBuffer().
|
protected |
Definition at line 75 of file XrdCephOssBufferedFile.hh.
Referenced by Close(), createBuffer(), and Read().
|
protected |
Definition at line 84 of file XrdCephOssBufferedFile.hh.
Referenced by createBuffer().
|
protected |
Definition at line 88 of file XrdCephOssBufferedFile.hh.
|
protected |
number of bytes read or written
Definition at line 90 of file XrdCephOssBufferedFile.hh.
|
protected |
number of bytes read or written
Definition at line 89 of file XrdCephOssBufferedFile.hh.
|
protected |
number of bytes read or written
Definition at line 91 of file XrdCephOssBufferedFile.hh.
|
protected |
number of bytes read or written
Definition at line 92 of file XrdCephOssBufferedFile.hh.
|
protected |
create a new instance of the buffer
Definition at line 72 of file XrdCephOssBufferedFile.hh.
Referenced by createBuffer().
|
protected |
number of ms to sleep if a retry is requested
Definition at line 83 of file XrdCephOssBufferedFile.hh.
|
protected |
set the maximum of buffers to open on a single instance (e.g. for simultaneous file reads)
Definition at line 80 of file XrdCephOssBufferedFile.hh.
|
protected |
How many times to retry a ready from a buffer with EBUSY errors.
Definition at line 81 of file XrdCephOssBufferedFile.hh.
|
protected |
any data access method on the buffer will use this
Definition at line 77 of file XrdCephOssBufferedFile.hh.
Referenced by createBuffer().
|
protected |
Definition at line 86 of file XrdCephOssBufferedFile.hh.
|
protected |
Definition at line 87 of file XrdCephOssBufferedFile.hh.
|
protected |
Definition at line 73 of file XrdCephOssBufferedFile.hh.
Referenced by ~XrdCephOssBufferedFile(), Close(), createBuffer(), Fstat(), Fsync(), Ftruncate(), Open(), Read(), ReadRaw(), and ReadV().