![]() |
XRootD
|
#include <XrdCephBulkAioRead.hh>
Public Member Functions | |
bulkAioRead (librados::IoCtx *ct, logfunc_pointer ptr, CephFileRef *fileref) | |
~bulkAioRead () | |
void | clear () |
ssize_t | get_results () |
int | read (void *out_buf, size_t size, off64_t offset) |
int | submit_and_wait_for_complete () |
Definition at line 10 of file XrdCephBulkAioRead.hh.
bulkAioRead::bulkAioRead | ( | librados::IoCtx * | ct, |
logfunc_pointer | ptr, | ||
CephFileRef * | fileref | ||
) |
Class is used to execute read operations against rados striper files without usage of rados striper. Reads are based on ceph read operations.
The interface is similar to the one that ceph's read operation objects has:
WARNING: there is no copy/move constructor in the class, so do not use temporary objects for initialization (i.e. something like bulkAioRead rop = bulkAioRead(...);
will not work, use bulkAioRead rop(...);
instead).
Constructor.
ct | Rados IoContext object |
logfunc_pointer | Pointer to the function that will be used for logging |
fileref | Ceph file reference |
Definition at line 4 of file XrdCephBulkAioRead.cc.
References logwrapper().
bulkAioRead::~bulkAioRead | ( | ) |
Destructor. Just clears dynamically allocated memroy.
Definition at line 18 of file XrdCephBulkAioRead.cc.
References clear().
void bulkAioRead::clear | ( | ) |
Clear all dynamically alocated memory
Definition at line 25 of file XrdCephBulkAioRead.cc.
Referenced by ~bulkAioRead(), and get_results().
ssize_t bulkAioRead::get_results | ( | ) |
Copy the results of executed read requests from ceph's bufferlists to client's buffers
Note that this method should be called only after the submission and completion of read requests, i.e. after submit_and_wait_for_complete
method.
Definition at line 114 of file XrdCephBulkAioRead.cc.
References clear().
Referenced by ceph_nonstriper_readv(), and ceph_posix_nonstriper_pread().
int bulkAioRead::read | ( | void * | out_buf, |
size_t | size, | ||
off64_t | offset | ||
) |
Declare a read operation for file.
Read coordinates are global, i.e. valid offsets are from 0 to the <file_size> -1, valid request sizes are from 0 to INF. Method can be called multiple times to declare multiple read operations on the same file.
out_buf | output buffer, where read results should be stored |
req_size | number of bytes to read |
offset | offset in bytes where the read should start. Note that the offset is global, i.e. refers to the whole file, not individual ceph objects |
Definition at line 141 of file XrdCephBulkAioRead.cc.
References CephFile::name, and CephFile::objectSize.
Referenced by ceph_nonstriper_readv(), and ceph_posix_nonstriper_pread().
int bulkAioRead::submit_and_wait_for_complete | ( | ) |
Submit previously prepared read requests and wait for their completion
To prepare read requests use read
or addRequest
methods.
Definition at line 64 of file XrdCephBulkAioRead.cc.
References CephFile::name.
Referenced by ceph_nonstriper_readv(), and ceph_posix_nonstriper_pread().