xrootd
XrdFileCacheIOFileBlock.hh
Go to the documentation of this file.
1#ifndef __XRDFILECACHE_IO_FILE_BLOCK_HH__
2#define __XRDFILECACHE_IO_FILE_BLOCK_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#include <map>
21#include <string>
22
25
26#include "XrdFileCacheIO.hh"
27
28class XrdSysError;
29class XrdOssDF;
30
31namespace XrdFileCache
32{
33//----------------------------------------------------------------------------
37//----------------------------------------------------------------------------
38class IOFileBlock : public IO
39{
40public:
41 //------------------------------------------------------------------------
43 //------------------------------------------------------------------------
45
46 //------------------------------------------------------------------------
48 //------------------------------------------------------------------------
50
51 //---------------------------------------------------------------------
55 //---------------------------------------------------------------------
57
58 //---------------------------------------------------------------------
60 //---------------------------------------------------------------------
62
63 virtual int Read(char *Buffer, long long Offset, int Length);
64
67 virtual bool ioActive();
68
69 virtual int Fstat(struct stat &sbuff);
70
71 virtual long long FSize();
72
73private:
74 long long m_blocksize;
75 std::map<int, File*> m_blocks;
80
83 File* newBlockFile(long long off, int blocksize);
85};
86}
87
88#endif
#define stat(a, b)
Definition: XrdPosix.hh:96
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
Definition: XrdFileCache.hh:130
Definition: XrdFileCacheFile.hh:134
Downloads original file into multiple files, chunked into blocks. Only blocks that are asked for are ...
Definition: XrdFileCacheIOFileBlock.hh:39
XrdSysMutex m_mutex
map mutex
Definition: XrdFileCacheIOFileBlock.hh:76
struct stat * m_localStat
Definition: XrdFileCacheIOFileBlock.hh:77
virtual XrdOucCacheIO * Detach()
virtual bool ioActive()
Virtual method of XrdOucCacheIO. Called to check if destruction needs to be done in a separate task.
Info m_info
Definition: XrdFileCacheIOFileBlock.hh:78
IOFileBlock(XrdOucCacheIO2 *io, XrdOucCacheStats &stats, Cache &cache)
Constructor.
virtual long long FSize()
virtual int Read(char *Buffer, long long Offset, int Length)
std::map< int, File * > m_blocks
map of created blocks
Definition: XrdFileCacheIOFileBlock.hh:75
File * newBlockFile(long long off, int blocksize)
long long m_blocksize
size of file-block
Definition: XrdFileCacheIOFileBlock.hh:74
XrdOssDF * m_infoFile
Definition: XrdFileCacheIOFileBlock.hh:79
virtual int Fstat(struct stat &sbuff)
Base cache-io class that implements XrdOucCacheIO abstract methods.
Definition: XrdFileCacheIO.hh:17
Status of cached file. Can be read from and written into a binary file.
Definition: XrdFileCacheInfo.hh:49
Definition: XrdOss.hh:60
Definition: XrdOucCache2.hh:63
virtual void Read(XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
Definition: XrdOucCache2.hh:107
Definition: XrdOucCache.hh:128
Definition: XrdOucCacheStats.hh:41
Definition: XrdSysError.hh:90
Definition: XrdSysPthread.hh:166
Definition: XrdFileCache.hh:40