XRootD
Loading...
Searching...
No Matches
XrdCephOssReadVFile.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN)
3// Author: Sebastien Ponce <sebastien.ponce@cern.ch>
4//------------------------------------------------------------------------------
5// This file is part of the XRootD software suite.
6//
7// XRootD is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// XRootD is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19//
20// In applying this licence, CERN does not waive the privileges and immunities
21// granted to it by virtue of its status as an Intergovernmental Organization
22// or submit itself to any jurisdiction.
23//------------------------------------------------------------------------------
24
25#ifndef __XRD_CEPH_OSS_READV_FILE_HH__
26#define __XRD_CEPH_OSS_READV_FILE_HH__
27
28#include "XrdOss/XrdOss.hh"
29#include "XrdCeph/XrdCephOss.hh"
31
35
36#include <memory>
37
38
39//------------------------------------------------------------------------------
44//------------------------------------------------------------------------------
45
46class XrdCephOssReadVFile : virtual public XrdCephOssFile {
47
48public:
49
50 explicit XrdCephOssReadVFile(XrdCephOss *cephoss, XrdCephOssFile *cephossDF,const std::string& algname);
51 virtual ~XrdCephOssReadVFile();
52 virtual int Open(const char *path, int flags, mode_t mode, XrdOucEnv &env);
53 virtual int Close(long long *retsz=0);
54
55//-----------------------------------------------------------------------------
63//-----------------------------------------------------------------------------
64 virtual ssize_t ReadV(XrdOucIOVec *readV, int rdvcnt);
65
66 virtual ssize_t Read(off_t offset, size_t blen);
67 virtual ssize_t Read(void *buff, off_t offset, size_t blen);
68 virtual int Read(XrdSfsAio *aoip);
69 virtual ssize_t ReadRaw(void *, off_t, size_t);
70 virtual int Fstat(struct stat *buff);
71 virtual ssize_t Write(const void *buff, off_t offset, size_t blen);
72 virtual int Write(XrdSfsAio *aiop);
73 virtual int Fsync(void);
74 virtual int Ftruncate(unsigned long long);
75
76protected:
78 XrdCephOssFile * m_xrdOssDF = nullptr; // holder of the XrdCephOssFile instance
79 bool m_extraLogging = true; // use verbose logging
80 std::string m_algname = "passthrough";
81 std::unique_ptr<XrdCephBuffer::IXrdCephReadVAdapter> m_readVAdapter;
82
83 std::atomic<long> m_timer_read_ns {0};
84 std::atomic<long> m_timer_count {0};
85 std::atomic<long> m_timer_size {0};
86 std::atomic<long> m_timer_longest {0};
87
88
89};
90
91#endif /* __XRD_CEPH_OSS_READV_FILE_HH__ */
#define stat(a, b)
Definition XrdPosix.hh:101
XrdCephOssFile(XrdCephOss *cephoss)
virtual int Close(long long *retsz=0)
std::atomic< long > m_timer_longest
number of reads
virtual ssize_t Read(off_t offset, size_t blen)
std::atomic< long > m_timer_size
number of reads
std::unique_ptr< XrdCephBuffer::IXrdCephReadVAdapter > m_readVAdapter
virtual ssize_t ReadV(XrdOucIOVec *readV, int rdvcnt)
std::atomic< long > m_timer_read_ns
virtual ssize_t Write(const void *buff, off_t offset, size_t blen)
std::atomic< long > m_timer_count
timer for the reads against ceph
virtual int Open(const char *path, int flags, mode_t mode, XrdOucEnv &env)
XrdCephOssReadVFile(XrdCephOss *cephoss, XrdCephOssFile *cephossDF, const std::string &algname)
virtual int Ftruncate(unsigned long long)
virtual ssize_t ReadRaw(void *, off_t, size_t)
XrdCephOssFile * m_xrdOssDF
virtual int Fstat(struct stat *buff)