xrootd
Loading...
Searching...
No Matches
XrdPfcIOFile.hh
Go to the documentation of this file.
1#ifndef __XRDPFC_IO_ENTIRE_FILE_HH__
2#define __XRDPFC_IO_ENTIRE_FILE_HH__
3//----------------------------------------------------------------------------------
4// Copyright (c) 2014 by Board of Trustees of the Leland Stanford, Jr., University
5// Author: Alja Mrak-Tadel, Matevz Tadel, Brian Bockelman
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
21#include <string>
22
24#include "XrdPfcIO.hh"
25#include "XrdPfc.hh"
26#include "XrdPfcStats.hh"
27#include "XrdPfcFile.hh"
28
29class XrdSysError;
30class XrdOssDF;
31class XrdOucIOVec;
32
33namespace XrdPfc
34{
35//----------------------------------------------------------------------------
38//----------------------------------------------------------------------------
39class IOFile : public IO
40{
41public:
43
45
46 //------------------------------------------------------------------------
48 //------------------------------------------------------------------------
49 bool HasFile() const { return m_file != 0; }
50
51 //---------------------------------------------------------------------
53 //---------------------------------------------------------------------
54 int Read(char *buff, long long off, int size) override;
55 void Read(XrdOucCacheIOCB &iocb, char *buff, long long off, int size) override;
56 void pgRead(XrdOucCacheIOCB &iocb, char *buff, long long off, int size,
57 std::vector<uint32_t> &csvec, uint64_t opts=0, int *csfix=0) override;
59
60 //---------------------------------------------------------------------
62 //---------------------------------------------------------------------
63 int ReadV(const XrdOucIOVec *readV, int n) override;
64 void ReadV(XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int n) override;
65
66 void Update(XrdOucCacheIO &iocp) override;
67
70 bool ioActive() override;
71
74 void DetachFinalize() override;
75
76 int Fstat(struct stat &sbuff) override;
77
78 long long FSize() override;
79
80private:
82
83 int ReadBegin(char *buff, long long off, int size, ReadReqRH *rh);
84 int ReadEnd(int retval, ReadReqRH *rh);
85
86 int ReadVBegin(const XrdOucIOVec *readV, int n, ReadReqRH *rh);
87 int ReadVEnd(int retval, ReadReqRH *rh);
88
91
92
93};
94
95}
96#endif
97
#define stat(a, b)
Definition XrdPosix.hh:96
Definition XrdOss.hh:63
Definition XrdOucCache.hh:53
Definition XrdOucCache.hh:105
virtual int pgRead(char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
Definition XrdPfc.hh:264
Definition XrdPfcFile.hh:213
Downloads original file into a single file on local disk. Handles read requests as they come along.
Definition XrdPfcIOFile.hh:40
int Read(char *buff, long long off, int size) override
Pass Read request to the corresponding File object.
void Update(XrdOucCacheIO &iocp) override
int Fstat(struct stat &sbuff) override
int ReadVBegin(const XrdOucIOVec *readV, int n, ReadReqRH *rh)
IOFile(XrdOucCacheIO *io, Cache &cache)
void DetachFinalize() override
Abstract virtual method of XrdPfc::IO Called to destruct the IO object after it is no longer used.
bool HasFile() const
Check if File was opened successfully.
Definition XrdPfcIOFile.hh:49
File * m_file
Definition XrdPfcIOFile.hh:81
struct stat * m_localStat
Definition XrdPfcIOFile.hh:89
bool ioActive() override
Abstract virtual method of XrdPfc::IO Called to check if destruction needs to be done in a separate t...
int ReadV(const XrdOucIOVec *readV, int n) override
Pass ReadV request to the corresponding File object.
int ReadBegin(char *buff, long long off, int size, ReadReqRH *rh)
long long FSize() override
void Read(XrdOucCacheIOCB &iocb, char *buff, long long off, int size) override
void ReadV(XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int n) override
int initCachedStat()
void pgRead(XrdOucCacheIOCB &iocb, char *buff, long long off, int size, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0) override
int ReadVEnd(int retval, ReadReqRH *rh)
int ReadEnd(int retval, ReadReqRH *rh)
Base cache-io class that implements some XrdOucCacheIO abstract methods.
Definition XrdPfcIO.hh:18
Definition XrdSysError.hh:90
Definition XrdPfc.hh:41
Definition XrdOucIOVec.hh:41
Definition XrdPfcFile.hh:61