199 virtual void Delete(
const char *namecycle=
"");
203 virtual void Flush();
248 virtual void MakeProject(
const char *dirname,
const char *classes=
"*",
324 UInt_t buffersize = 1000000);
335#define gFile (TFile::CurrentFile())
337#elif defined(__MAKECINT__)
#define ClassDef(name, id)
This class is a TS set of unsigned set.
Class describing an archive file containing multiple sub-files, like a ZIP or TAR archive.
Array of chars or bytes (8 bits per element).
Manages buffers for branches of a Tree.
The ROOT global object gROOT contains a list of all defined classes.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A ROOT file is structured in Directories (like a file system).
Describe directory structure in memory.
A cache when reading files over the network.
A cache when writing files over the network.
Class holding info about the file being opened.
TFile * fFile
TFile instance of the file being opened.
Int_t fNetOpt
Network options.
TFileOpenHandle(TFile *f)
TFileOpenHandle(const char *n, const char *o, const char *t, Int_t cmp, Int_t no)
TFileOpenHandle(const TFileOpenHandle &)
Int_t fCompress
Compression level and algorithm.
const char * GetOpt() const
Bool_t Matches(const char *name)
Return kTRUE if this async request matches the open request specified by 'url'.
TFileOpenHandle & operator=(const TFileOpenHandle &)
Int_t GetCompress() const
The prefetching mechanism uses two classes (TFilePrefetch and TFPBlock) to prefetch in advance a bloc...
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void ls(Option_t *option="") const
List file contents.
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
static void SetFileBytesWritten(Long64_t bytes=0)
static Bool_t fgCacheFileForce
Indicates, to force all READ to CACHEREAD.
Long64_t fBytesRead
Number of bytes read from this file.
virtual Long64_t GetSeekFree() const
virtual TProcessID * ReadProcessID(UShort_t pidf)
The TProcessID with number pidf is read from this file.
virtual void Seek(Long64_t offset, ERelativeTo pos=kBeg)
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
static Bool_t GetOnlyStaged()
Returns staged only flag.
static void IncrementFileCounter()
static Bool_t ShrinkCacheFileDir(Long64_t shrinkSize, Long_t cleanupInteval=0)
Try to shrink the cache to the desired size.
Long64_t fSeekFree
Location on disk of free segments structure.
static Int_t fgReadaheadSize
Readahead buffer size.
Double_t fSum2Buffer
Sum of squares of buffer sizes of objects written so far.
static void SetReadaheadSize(Int_t bufsize=256000)
static Bool_t fgCacheFileDisconnected
Indicates, we trust in the files in the cache dir without stat on the cached file.
const TList * GetStreamerInfoCache()
Returns the cached list of StreamerInfos used in this file.
static Bool_t GetReadStreamerInfo()
If the streamerinfos are to be read at file opening.
TArchiveFile * fArchive
!Archive file from which we read this file
virtual void Delete(const char *namecycle="")
Delete object namecycle.
virtual Int_t SysSync(Int_t fd)
Interface to system fsync. All arguments like in POSIX fsync().
virtual void Close(Option_t *option="")
Close a file.
virtual Long64_t DirCreateEntry(TDirectory *)
virtual Int_t ReOpen(Option_t *mode)
Reopen a file with a different access mode.
virtual void ReadStreamerInfo()
Read the list of StreamerInfo from this file.
virtual Bool_t Matches(const char *name)
Return kTRUE if 'url' matches the coordinates of this file.
TArrayC * fClassIndex
!Index of TStreamerInfo classes written to this file
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
virtual InfoListRet GetStreamerInfoListImpl(bool lookupSICache)
See documentation of GetStreamerInfoList for more details.
Int_t GetCompressionSettings() const
static void SetReadStreamerInfo(Bool_t readinfo=kTRUE)
Specify if the streamerinfos must be read at file opening.
virtual Int_t Sizeof() const
Return the size in bytes of the file header.
Bool_t fNoAnchorInName
!True if we don't want to force the anchor to be appended to the file name
virtual Int_t DirReadKeys(TDirectory *)
static void SetFileBytesRead(Long64_t bytes=0)
TArrayC * GetClassIndex() const
Long64_t fSeekInfo
Location on disk of StreamerInfo record.
TList * GetListOfFree() const
Int_t GetBestBuffer() const
Return the best buffer size of objects on this file.
TList * fOpenPhases
!Time info about open phases
virtual void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
TFileCacheWrite * GetCacheWrite() const
Return a pointer to the current write cache.
static void SetFileReadCalls(Int_t readcalls=0)
static TString fgCacheFileDir
Directory where to locally stage files.
virtual Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read().
static EFileType GetType(const char *name, Option_t *option="", TString *prefix=0)
Resolve the file type as a function of the protocol field in 'name'.
Int_t fVersion
File format version.
virtual void FillBuffer(char *&buffer)
Encode file output buffer.
static std::atomic< Long64_t > fgFileCounter
Counter for all opened files.
virtual EAsyncOpenStatus GetAsyncOpenStatus()
static UInt_t GetOpenTimeout()
Returns open timeout (in ms).
static void CpProgress(Long64_t bytesread, Long64_t size, TStopwatch &watch)
Print file copy progress.
Long64_t GetArchiveOffset() const
static Bool_t fgOnlyStaged
Before the file is opened, it is checked, that the file is staged, if not, the open fails.
virtual Int_t GetNProcessIDs() const
Bool_t fMustFlush
!True if the file buffers must be flushed
Int_t WriteBufferViaCache(const char *buf, Int_t len)
Write buffer via cache.
static ROOT::TRWSpinLock fgRwLock
!Read-write lock to protect global PID list
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Int_t ReadBufferViaCache(char *buf, Int_t len)
Read buffer via cache.
virtual TKey * CreateKey(TDirectory *mother, const TObject *obj, const char *name, Int_t bufsize)
Creates key for object and converts data to buffer.
virtual void WriteFree()
Write FREE linked list on the file.
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
virtual Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read the nbuf blocks described in arrays pos and len.
static Long64_t GetFileCounter()
TMap * fCacheReadMap
!Pointer to the read cache (if any)
Long64_t fBEGIN
First used byte in file.
Int_t MakeProjectParProofInf(const char *packname, const char *proofinfdir)
Create BUILD.sh and SETUP.C under 'proofinf' for PAR package 'pack'.
virtual UShort_t WriteProcessID(TProcessID *pid)
Check if the ProcessID pidd is already in the file, if not, add it and return the index number in the...
virtual void MakeProject(const char *dirname, const char *classes="*", Option_t *option="new")
Generate source code necessary to access the objects stored in the file.
Long64_t fArchiveOffset
!Offset at which file starts in archive
EOpenTimeOut
Open timeout constants.
Int_t fNbytesInfo
Number of bytes for StreamerInfo record.
virtual Long64_t GetSize() const
Returns the current file size.
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
TFileOpenHandle * fAsyncHandle
!For proper automatic cleanup
static Bool_t SetOnlyStaged(Bool_t onlystaged)
Sets only staged flag.
virtual Int_t GetReadCalls() const
virtual TString GetNewUrl()
virtual Long64_t GetBytesRead() const
virtual Int_t GetErrno() const
Method returning errno. Is overriden in TRFIOFile.
Int_t GetCompressionLevel() const
static Bool_t fgReadInfo
if true (default) ReadStreamerInfo is called when opening a file
virtual void Init(Bool_t create)
Initialize a TFile object.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
Long64_t GetRelOffset() const
virtual void SetReadCalls(Int_t readcalls=0)
virtual void SetCacheWrite(TFileCacheWrite *cache)
Set a pointer to the write cache.
TString fOption
File options.
virtual Int_t GetNfree() const
virtual Long64_t GetEND() const
virtual Bool_t WriteBuffer(const char *buf, Int_t len)
Write a buffer to the file.
static TFileOpenHandle * AsyncOpen(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Submit an asynchronous open request.
void SumBuffer(Int_t bufsize)
Increment statistics for buffer sizes of objects in this file.
static const char * GetCacheFileDir()
Get the directory where to locally stage/cache remote files.
EAsyncOpenStatus
Asynchronous open request status.
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
virtual Long64_t GetSeekInfo() const
Int_t fCompress
Compression level and algorithm.
virtual Int_t GetNbytesFree() const
virtual Bool_t IsArchive() const
static TFile *& CurrentFile()
Return the current ROOT file if any.
virtual void SetEND(Long64_t last)
virtual void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
See comments for function SetCompressionSettings.
virtual const TUrl * GetEndpointUrl() const
Int_t fNbytesFree
Number of bytes for free segments structure.
virtual void ResetErrno() const
Method resetting the errno. Is overridden in TRFIOFile.
Bool_t FlushWriteCache()
Flush the write cache if active.
virtual void IncrementProcessIDs()
Bool_t fIsPcmFile
!True if the file is a ROOT pcm file.
TFileCacheRead * fCacheRead
!Pointer to the read cache (if any)
virtual Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close().
TFile()
File default Constructor.
Char_t fUnits
Number of bytes for file pointers.
TObjArray * fProcessIDs
!Array of pointers to TProcessIDs
virtual void SetOption(Option_t *option=">")
virtual void ShowStreamerInfo()
Show the StreamerInfo of all classes written to this file.
virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
virtual ~TFile()
File destructor.
virtual Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Return file stat information.
virtual void Print(Option_t *option="") const
Print all objects in the file.
virtual Long64_t GetBytesReadExtra() const
virtual void Draw(Option_t *option="")
Fill Graphics Structure and Paint.
virtual Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open().
ECacheAction
TTreeCache flushing semantics.
static UInt_t SetOpenTimeout(UInt_t timeout)
Sets open timeout time (in ms). Returns previous timeout value.
virtual void ReadFree()
Read the FREE linked list.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
static ROOT::Internal::RConcurrentHashColl fgTsSIHashes
!TS Set of hashes built from read streamer infos
Long64_t fBytesReadExtra
Number of extra bytes (overhead) read by the readahead buffer.
Long64_t fBytesWrite
Number of bytes written to this file.
TArchiveFile * GetArchive() const
Bool_t fIsRootFile
!True is this is a ROOT file, raw file otherwise
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
virtual void Paint(Option_t *option="")
Paint all objects in the file.
virtual void DirWriteKeys(TDirectory *)
TList * fFree
Free segments linked list table.
virtual Bool_t ReadBufferAsync(Long64_t offs, Int_t len)
std::mutex fWriteMutex
!Lock for writing baskets / keys into the file.
Bool_t fInitDone
!True if the file has been initialized
virtual void DrawMap(const char *keys="*", Option_t *option="")
Draw map of objects in this file.
virtual void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose)
Used to specify the compression level and algorithm.
TFileCacheRead * GetCacheRead(const TObject *tree=0) const
Return a pointer to the current read cache.
virtual void DirWriteHeader(TDirectory *)
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
TFileCacheWrite * fCacheWrite
!Pointer to the write cache (if any)
Option_t * GetOption() const
TString fRealName
Effective real file name (not original url)
virtual void SetOffset(Long64_t offset, ERelativeTo pos=kBeg)
Set position from where to start reading.
Long64_t fOffset
!Seek offset cache
static std::atomic< Long64_t > fgBytesWrite
Number of bytes written by all TFile objects.
virtual Int_t GetNbytesInfo() const
TList * fInfoCache
!Cached list of the streamer infos in this file
virtual Bool_t MustFlush() const
virtual Int_t GetBytesToPrefetch() const
Max number of bytes to prefetch.
static UInt_t fgOpenTimeout
Timeout for open operations in ms - 0 corresponds to blocking i/o.
Int_t MakeProjectParMake(const char *packname, const char *filename)
Create makefile at 'filemake' for PAR package 'pack'.
Long64_t fEND
Last used byte in file.
EAsyncOpenStatus fAsyncOpenStatus
!Status of an asynchronous open request
Double_t fSumBuffer
Sum of buffer sizes of objects written so far.
Bool_t fIsArchive
!True if this is a pure archive file
void operator=(const TFile &)
TObjArray * GetListOfProcessIDs() const
Int_t GetCompressionAlgorithm() const
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
virtual Int_t Recover()
Attempt to recover file if not correctly closed.
virtual TList * GetStreamerInfoList() final
Read the list of TStreamerInfo objects written to this file.
virtual void WriteHeader()
Write File Header.
virtual void Copy(TObject &) const
Copy this to obj.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
Int_t fNProcessIDs
Number of TProcessID written to this file.
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
Int_t fWritten
Number of objects written so far.
Int_t GetRecordHeader(char *buf, Long64_t first, Int_t maxbytes, Int_t &nbytes, Int_t &objlen, Int_t &keylen)
Read the logical record header starting at a certain postion.
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
Float_t GetCompressionFactor()
Return the file compression factor.
virtual Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write().
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
static TFile * OpenFromCache(const char *name, Option_t *="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Open a file for reading through the file cache.
static TList * fgAsyncOpenRequests
Book space in a file, create I/O buffers, to fill them, (un)compress them.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
A TProcessID identifies a ROOT job in a unique way in time and space.
const char * Data() const
This class represents a WWW compatible URL.
Namespace for new ROOT classes and functions.
basic_string_view< char > string_view
@ kUseGlobal
Use the global compression algorithm.
@ kUseGeneralPurpose
Use the recommended general-purpose setting; moderate read / write speed and compression ratio.
Simple struct of the return value of GetStreamerInfoListImpl.
ROOT::Internal::RConcurrentHashColl::HashValue fHash