XRootD
CephIOAdapterRaw.hh
Go to the documentation of this file.
1 #ifndef __CEPH_IO_ADAPTER_RAW_HH__
2 #define __CEPH_IO_ADAPTER_RAW_HH__
3 //------------------------------------------------------------------------------
4 // Interface of the logic part of the buffering
5 // Intention to be able to abstract the underlying implementation and code against the inteface
6 // e.g. for different complexities of control.
7 // Couples loosely to IXrdCepgBufferData and anticipated to be called by XrdCephOssBufferedFile.
8 // Should managage all of the IO and logic to give XrdCephOssBufferedFile only simple commands to call.
9 // implementations are likely to use (via callbacks?) CephPosix library code for actual reads and writes.
10 //------------------------------------------------------------------------------
11 
12 #include <sys/types.h>
13 #include "IXrdCephBufferData.hh"
14 #include "ICephIOAdapter.hh"
15 #include "BufferUtils.hh"
16 
17 #include <chrono>
18 #include <memory>
19 #include <atomic>
20 
21 namespace XrdCephBuffer {
22 
28 class CephIOAdapterRaw: public virtual ICephIOAdapter {
29  public:
30  CephIOAdapterRaw(IXrdCephBufferData * bufferdata, int fd,
31  bool useStriperlessReads);
32  virtual ~CephIOAdapterRaw();
33 
44  virtual ssize_t write(off64_t offset,size_t count) override;
45 
56  virtual ssize_t read(off64_t offset,size_t count) override;
57 
58  private:
59  IXrdCephBufferData * m_bufferdata;
60  int m_fd;
61  bool m_useStriperlessReads {true};
62 
63  // timer and counter info
64  std::atomic< long long> m_stats_read_timer{0}, m_stats_write_timer{0};
65  std::atomic< long long> m_stats_read_bytes{0}, m_stats_write_bytes{0};
66  std::atomic< long long> m_stats_read_req{0}, m_stats_write_req{0};
67  long long m_stats_read_longest{0}, m_stats_write_longest{0};
68 
69 };
70 
71 }
72 
73 #endif
Implements a non-async read and write to ceph via ceph_posix calls Using the standard ceph_posix_ cal...
virtual ssize_t read(off64_t offset, size_t count) override
Issue a ceph_posix_pread to read to the buffer data from file offset and len count....
virtual ssize_t write(off64_t offset, size_t count) override
Take the data in the buffer and write to ceph at given offset Issues a ceph_posix_pwrite for data in ...
CephIOAdapterRaw(IXrdCephBufferData *bufferdata, int fd, bool useStriperlessReads)
Manage the actual IO operations that read and write the data into Ceph via librados striper....
Interface to the Buffer's physical representation. Allow an interface to encapsulate the requirements...
is a simple implementation of IXrdCephBufferData using std::vector<char> representation for the buffe...
Definition: BufferUtils.hh:29