XrdClientReadAhead.hh

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////
00002 //                                                                      //
00003 // XrdClientReadAhead                                                   //
00004 //                                                                      //
00005 // Author: Fabrizio Furano (CERN IT-DM, 2009)                           //
00006 //                                                                      //
00007 // Classes to implement a selectable read ahead decision maker          //
00008 //                                                                      //
00009 //////////////////////////////////////////////////////////////////////////
00010 
00011 //         $Id: XrdClientReadAhead.hh 30949 2009-11-02 16:37:58Z ganis $
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

Generated on Tue Jul 5 14:46:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1