xrootd
XrdClientReadAhead.hh
Go to the documentation of this file.
1 #ifndef XRD_CLI_READAHEAD
2 #define XRD_CLI_READAHEAD
3 /******************************************************************************/
4 /* */
5 /* X r d C l i e n t R e a d A h e a d . h h */
6 /* */
7 /* Author: Fabrizio Furano (CERN IT-DM, 2009) */
8 /* */
9 /* This file is part of the XRootD software suite. */
10 /* */
11 /* XRootD is free software: you can redistribute it and/or modify it under */
12 /* the terms of the GNU Lesser General Public License as published by the */
13 /* Free Software Foundation, either version 3 of the License, or (at your */
14 /* option) any later version. */
15 /* */
16 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19 /* License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24 /* */
25 /* The copyright holder's institutional names and contributor's names may not */
26 /* be used to endorse or promote products derived from this software without */
27 /* specific prior written permission of the institution or contributor. */
28 /******************************************************************************/
29 
31 // //
32 // Classes to implement a selectable read ahead decision maker //
33 // //
35 
37 public:
42  };
43 
44 protected:
45  long RASize;
47 
48 public:
49 
51 
52 
54  virtual ~XrdClientReadAheadMgr() {};
55 
56  virtual int GetReadAheadHint(long long offset, long len, long long &raoffset, long &ralen, long blksize) = 0;
57  virtual int Reset() = 0;
58  virtual void SetRASize(long bytes) { RASize = bytes; };
59 
60  static bool TrimReadRequest(long long &offs, long &len, long rasize, long blksize);
61 
63 };
64 #endif
Definition: XrdClientReadAhead.hh:39
Definition: XrdClientReadAhead.hh:36
Definition: XrdClientReadAhead.hh:41
virtual ~XrdClientReadAheadMgr()
Definition: XrdClientReadAhead.hh:54
long RASize
Definition: XrdClientReadAhead.hh:45
virtual void SetRASize(long bytes)
Definition: XrdClientReadAhead.hh:58
Definition: XrdClientReadAhead.hh:40
static bool TrimReadRequest(long long &offs, long &len, long rasize, long blksize)
static XrdClientReadAheadMgr * CreateReadAheadMgr(XrdClient_RAStrategy strategy)
XrdClientReadAheadMgr()
Definition: XrdClientReadAhead.hh:53
XrdClient_RAStrategy currstrategy
Definition: XrdClientReadAhead.hh:46
XrdClient_RAStrategy
Definition: XrdClientReadAhead.hh:38
virtual int Reset()=0
virtual int GetReadAheadHint(long long offset, long len, long long &raoffset, long &ralen, long blksize)=0
XrdClient_RAStrategy GetCurrentStrategy()
Definition: XrdClientReadAhead.hh:62