12#ifndef ROOT_TFileMerger
13#define ROOT_TFileMerger
123 virtual void Reset();
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Describe directory structure in memory.
A class to pass information from the TFileMerger to the objects being merged.
virtual void SetFastMethod(Bool_t fast=kTRUE)
TString fObjectNames
List of object names to be either merged exclusively or skipped.
virtual Bool_t OutputFile(const char *url, Bool_t force)
Open merger output file.
TList fMergeList
list of TObjString containing the name of the files need to be merged
Bool_t GetNotrees() const
TFile * GetOutputFile() const
virtual Bool_t AddFile(TFile *source, Bool_t own, Bool_t cpProgress)
Add the TFile to this file merger and give ownership of the TFile to this object (unless kFALSE is re...
virtual void PrintFiles(Option_t *options)
Print list of files being merged.
const char * GetMsgPrefix() const
Bool_t fHistoOneGo
Merger histos in one go (default is kTRUE).
virtual Bool_t MergeRecursive(TDirectory *target, TList *sourcelist, Int_t type=kRegular|kAll)
Merge all objects in a directory.
void RecursiveRemove(TObject *obj) override
Intercept the case where the output TFile is deleted!
TList fFileList
A list the file (TFile*) which shall be merged.
void SetErrorBehavior(EErrorBehavior errBehavior)
Determines how the merging process should behave when encontering invalid objects.
virtual Bool_t Merge(Bool_t=kTRUE)
Merge the files.
virtual Bool_t MergeOne(TDirectory *target, TList *sourcelist, Int_t type, TFileMergeInfo &info, TString &oldkeyname, THashList &allNames, Bool_t &status, Bool_t &onlyListed, const TString &path, TDirectory *current_sourcedir, TFile *current_file, TKey *key, TObject *obj, TIter &nextkey)
TString fOutputFilename
The name of the outputfile for merging.
const char * GetObjectNames() const
ROOT::TIOFeatures TIOFeatures
const char * GetOutputFileName() const
TString fMsgPrefix
Prefix to be used when printing informational message (default TFileMerger).
TIOFeatures * fIOFeatures
IO features to use in the output file.
TFileMerger(const TFileMerger &)=delete
const char * GetMergeOptions()
void SetMsgPrefix(const char *prefix)
Set the prefix to be used when printing informational message.
Int_t GetPrintLevel() const
Bool_t fNoTrees
True if Trees should not be merged (default is kFALSE).
Bool_t HasCompressionChange() const
void SetPrintLevel(Int_t level)
bool fOutFileWasExplicitlyClosed
! the user has called CloseOutputFile(), so we shouldn't error out in RecursiveRemove
void AddObjectNames(const char *name)
Add object names for PartialMerge().
EPartialMergeType
Type of the partial merge.
@ kAll
Merge all type of objects (default).
@ kIncremental
Merge the input file with the content of the output file (if already existing).
@ kKeepCompression
Keep compression level unchanged for each input files.
@ kSkipListed
Skip objects specified in fObjectNames list.
@ kNonResetable
Only the objects without a MergeAfterReset member function.
@ kResetable
Only the objects with a MergeAfterReset member function.
@ kOnlyListed
Only the objects specified in fObjectNames list.
@ kAllIncremental
Merge incrementally all type of objects.
@ kRegular
Normal merge, overwriting the output file.
@ kDelayWrite
Delay the TFile write (to reduce the number of write when reusing the file).
void SetMergeOptions(const TString &options)
Bool_t fExplicitCompLevel
True if the user explicitly requested a compression level change (default kFALSE).
Bool_t fCompressionChange
True if the output and input have different compression level (default kFALSE).
EErrorBehavior fErrBehavior
What to do in case of errors during merging.
virtual void SetNotrees(Bool_t notrees=kFALSE)
Int_t fPrintLevel
How much information to print out at run time.
void SetMaxOpenedFiles(Int_t newmax)
Set a limit to the number of files that TFileMerger will open simultaneously.
TString fMergeOptions
Options (in string format) to be passed down to the Merge functions.
void CloseOutputFile()
Closes output file.
~TFileMerger() override
Cleanup.
@ kFailOnError
The merging process will stop and yield failure when encountering invalid objects.
@ kSkipOnError
The merging process will skip invalid objects and continue.
Int_t GetMaxOpenedFiles() const
Bool_t OpenExcessFiles()
Open up to (fMaxOpenedFiles-1) of the excess files.
void SetIOFeatures(ROOT::TIOFeatures &features)
TList fExcessFiles
! List of TObjString containing the name of the files not yet added to fFileList due to user or syste...
virtual const char * GetCWD()
TStopwatch fWatch
Stop watch to measure file copy speed.
TFile * fOutputFile
The outputfile for merging.
void SetMergeOptions(const std::string_view &options)
virtual Bool_t PartialMerge(Int_t type=kAll|kIncremental)
Merge the files.
Bool_t fLocal
Makes local copies of merging files if True (default is kTRUE).
TFileMerger & operator=(const TFileMerger &)=delete
virtual void Reset()
Reset merger file list.
Int_t fMaxOpenedFiles
Maximum number of files opened at the same time by the TFileMerger.
virtual Bool_t SetCWD(const char *)
virtual Bool_t AddAdoptFile(TFile *source, Bool_t cpProgress=kTRUE)
Add the TFile to this file merger and give ownership of the TFile to this object (unless kFALSE is re...
Bool_t fFastMethod
True if using Fast merging algorithm (default).
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Mother of all ROOT objects.
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...
TObject()
TObject constructor.