00001
00002
00003
00004
00005
00006
00007
00008
00010
00011
00012
00013 #ifndef XRD_CLI_READAHEAD
00014 #define XRD_CLI_READAHEAD
00015
00016
00017
00018 class XrdClientReadAheadMgr {
00019 public:
00020 enum XrdClient_RAStrategy {
00021 RAStr_none,
00022 RAStr_pureseq,
00023 RAStr_SlidingAvg
00024 };
00025
00026 protected:
00027 long RASize;
00028 XrdClient_RAStrategy currstrategy;
00029
00030 public:
00031
00032 static XrdClientReadAheadMgr *CreateReadAheadMgr(XrdClient_RAStrategy strategy);
00033
00034
00035 XrdClientReadAheadMgr() { RASize = 0; };
00036 virtual ~XrdClientReadAheadMgr() {};
00037
00038 virtual int GetReadAheadHint(long long offset, long len, long long &raoffset, long &ralen, long blksize) = 0;
00039 virtual int Reset() = 0;
00040 virtual void SetRASize(long bytes) { RASize = bytes; };
00041
00042 static bool TrimReadRequest(long long &offs, long &len, long rasize, long blksize);
00043
00044 XrdClient_RAStrategy GetCurrentStrategy() { return currstrategy; }
00045 };
00046
00047
00048
00049
00050
00051
00052
00053
00054 #endif