xrootd
XrdFileCacheIOEntireFile.hh
Go to the documentation of this file.
1 #ifndef __XRDFILECACHE_IO_ENTIRE_FILE_HH__
2 #define __XRDFILECACHE_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 
23 #include "XrdSys/XrdSysPthread.hh"
24 #include "XrdFileCache.hh"
25 #include "XrdFileCacheStats.hh"
26 #include "XrdFileCachePrefetch.hh"
27 
28 class XrdSysError;
29 class XrdOssDF;
30 class XfcStats;
31 class XrdOucIOVec;
32 
33 namespace XrdFileCache
34 {
35  //----------------------------------------------------------------------------
38  //----------------------------------------------------------------------------
39  class IOEntireFile : public IO
40  {
41  public:
42  //------------------------------------------------------------------------
44  //------------------------------------------------------------------------
45  IOEntireFile(XrdOucCacheIO &io, XrdOucCacheStats &stats, Cache &cache);
46 
47  //------------------------------------------------------------------------
49  //------------------------------------------------------------------------
50  ~IOEntireFile();
51 
52  //---------------------------------------------------------------------
60  //---------------------------------------------------------------------
61  virtual int Read(char *Buffer, long long Offset, int Length);
62 
63  //---------------------------------------------------------------------
70  //---------------------------------------------------------------------
71  virtual int ReadV(const XrdOucIOVec *readV, int n);
72 
73  //---------------------------------------------------------------------
77  //---------------------------------------------------------------------
78  virtual XrdOucCacheIO* Detach();
79 
82  virtual bool ioActive();
83 
84  protected:
86  virtual void StartPrefetch();
87 
88  private:
90  };
91 
92 }
93 #endif
Definition: XrdFileCache.hh:30
Prefetch * m_prefetch
Definition: XrdFileCacheIOEntireFile.hh:89
virtual XrdOucCacheIO * Detach()
virtual void StartPrefetch()
Run prefetch outside constructor.
Definition: XrdOucCache.hh:158
virtual int Read(char *Buffer, long long Offset, int Length)
Definition: XrdSysError.hh:87
Downloads data into a file on local disk and handles IO read requests.
Definition: XrdFileCachePrefetch.hh:42
Base cache-io class that implements XrdOucCacheIO abstract methods.
Definition: XrdFileCache.hh:125
virtual int ReadV(const XrdOucIOVec *readV, int n)
Definition: XrdOucIOVec.hh:40
Downloads original file into a single file on local disk. Handles read requests as they come along...
Definition: XrdFileCacheIOEntireFile.hh:39
virtual bool ioActive()
Virtual method of XrdOucCacheIO. Called to check if destruction needs to be done in a separate task...
Definition: XrdOss.hh:59
Definition: XrdOucCache.hh:93
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
Definition: XrdFileCache.hh:39
IOEntireFile(XrdOucCacheIO &io, XrdOucCacheStats &stats, Cache &cache)
Constructor.