Warning, file /include/root/TFileCacheRead.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TFileCacheRead
0013 #define ROOT_TFileCacheRead
0014
0015 #include "TObject.h"
0016
0017 #include "TFile.h"
0018
0019 class TBranch;
0020 class TFilePrefetch;
0021
0022 class TFileCacheRead : public TObject {
0023
0024 protected:
0025 TFilePrefetch *fPrefetch;
0026 Int_t fBufferSizeMin;
0027 Int_t fBufferSize;
0028 Int_t fBufferLen;
0029
0030 Long64_t fBytesRead;
0031 Long64_t fBytesReadExtra;
0032 Int_t fReadCalls;
0033 Long64_t fNoCacheBytesRead;
0034 Int_t fNoCacheReadCalls;
0035
0036 Bool_t fAsyncReading;
0037 Bool_t fEnablePrefetching;
0038
0039 Int_t fNseek;
0040 Int_t fNtot;
0041 Int_t fNb;
0042 Int_t fSeekSize;
0043 Long64_t *fSeek;
0044 Long64_t *fSeekSort;
0045 Int_t *fSeekIndex;
0046 Long64_t *fPos;
0047 Int_t *fSeekLen;
0048 Int_t *fSeekSortLen;
0049 Int_t *fSeekPos;
0050 Int_t *fLen;
0051 TFile *fFile;
0052 char *fBuffer;
0053 Bool_t fIsSorted;
0054 Bool_t fIsTransferred;
0055 Long64_t fPrefetchedBlocks;
0056
0057
0058 Int_t fBNseek;
0059 Int_t fBNtot;
0060 Int_t fBNb;
0061 Int_t fBSeekSize;
0062 Long64_t *fBSeek;
0063 Long64_t *fBSeekSort;
0064 Int_t *fBSeekIndex;
0065 Long64_t *fBPos;
0066 Int_t *fBSeekLen;
0067 Int_t *fBSeekSortLen;
0068 Int_t *fBSeekPos;
0069 Int_t *fBLen;
0070 Bool_t fBIsSorted;
0071 Bool_t fBIsTransferred;
0072
0073 void SetEnablePrefetchingImpl(Bool_t setPrefetching = kFALSE);
0074
0075 private:
0076 TFileCacheRead(const TFileCacheRead &) = delete;
0077 TFileCacheRead& operator=(const TFileCacheRead &) = delete;
0078
0079 public:
0080 TFileCacheRead();
0081 TFileCacheRead(TFile *file, Int_t buffersize, TObject *tree = nullptr);
0082 ~TFileCacheRead() override;
0083 virtual Int_t AddBranch(TBranch * , Bool_t = kFALSE) { return 0; }
0084 virtual Int_t AddBranch(const char * , Bool_t = kFALSE) { return 0; }
0085 virtual void AddNoCacheBytesRead(Long64_t len) { fNoCacheBytesRead += len; }
0086 virtual void AddNoCacheReadCalls(Int_t reads) { fNoCacheReadCalls += reads; }
0087 virtual void Close(Option_t *option="");
0088 virtual Int_t GetBufferSize() const { return fBufferSize; };
0089 virtual Long64_t GetBytesRead() const { return fBytesRead; }
0090 virtual Long64_t GetNoCacheBytesRead() const { return fNoCacheBytesRead; }
0091 virtual Long64_t GetBytesReadExtra() const { return fBytesReadExtra; }
0092 TFile *GetFile() const { return fFile; }
0093 Int_t GetNseek() const { return fNseek; }
0094 Int_t GetNtot() const { return fNtot; }
0095 virtual Int_t GetReadCalls() const { return fReadCalls; }
0096 virtual Int_t GetNoCacheReadCalls() const { return fNoCacheReadCalls; }
0097 virtual Int_t GetUnzipBuffer(char ** , Long64_t , Int_t , Bool_t * ) { return -1; }
0098 Long64_t GetPrefetchedBlocks() const { return fPrefetchedBlocks; }
0099 virtual Bool_t IsAsyncReading() const { return fAsyncReading; };
0100 virtual void SetEnablePrefetching(Bool_t setPrefetching = kFALSE);
0101 virtual Bool_t IsEnablePrefetching() const { return fEnablePrefetching; };
0102 virtual Bool_t IsLearning() const {return kFALSE;}
0103 virtual Int_t LearnBranch(TBranch * , Bool_t = kFALSE) { return 0; }
0104 virtual void Prefetch(Long64_t pos, Int_t len);
0105 void Print(Option_t *option="") const override;
0106 virtual Int_t ReadBufferExt(char *buf, Long64_t pos, Int_t len, Int_t &loc);
0107 virtual Int_t ReadBufferExtNormal(char *buf, Long64_t pos, Int_t len, Int_t &loc);
0108 virtual Int_t ReadBufferExtPrefetch(char *buf, Long64_t pos, Int_t len, Int_t &loc);
0109 virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len);
0110 virtual Int_t SetBufferSize(Int_t buffersize);
0111 virtual void SetFile(TFile *file, TFile::ECacheAction action = TFile::kDisconnect);
0112 virtual void SetSkipZip(Bool_t = kTRUE) {}
0113 virtual void Sort();
0114 virtual void SecondSort();
0115 virtual void SecondPrefetch(Long64_t, Int_t);
0116 virtual TFilePrefetch* GetPrefetchObj();
0117 virtual void WaitFinishPrefetch();
0118
0119 ClassDefOverride(TFileCacheRead,2)
0120 };
0121
0122 #endif