39 Error(
"TBufferMerger",
"cannot write to output file");
47 if (!
f.expired())
Fatal(
"TBufferMerger",
" TBufferMergerFiles must be destroyed before the server");
63 gROOT->GetListOfFiles()->Remove(
f.get());
117 std::queue<TBufferFile *> queue;
124 while (!queue.empty()) {
125 std::unique_ptr<TBufferFile> buffer{queue.front()};
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
R__EXTERN TVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
A TBufferMergerFile is similar to a TMemFile, but when data is written to it, it is appended to the T...
size_t GetAutoSave() const
Returns the current value of the auto save setting in bytes (default = 0).
std::atomic< size_t > fBuffered
bool TryMerge(TBufferMergerFile *memfile)
std::vector< std::weak_ptr< TBufferMergerFile > > fAttachedFiles
void SetAutoSave(size_t size)
By default, TBufferMerger will call TFileMerger::PartialMerge() for each buffer pushed onto its merge...
friend class TBufferMergerFile
std::queue< TBufferFile * > fQueue
virtual ~TBufferMerger()
Destructor.
void Push(TBufferFile *buffer)
std::shared_ptr< TBufferMergerFile > GetFile()
Returns a TBufferMergerFile to which data can be written.
const char * GetMergeOptions()
Returns the current merge options.
TBufferMerger()
TBufferMerger has no default constructor.
void SetMergeOptions(const TString &options)
Sets the merge options.
void Init(std::unique_ptr< TFile >)
size_t GetQueueSize() const
Returns the number of buffers currently in the queue.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
TDirectory::TContext keeps track and restore the current directory.
virtual Bool_t OutputFile(const char *url, Bool_t force)
Open merger output file.
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...
const char * GetOutputFileName() const
const char * GetMergeOptions()
@ 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.
@ kDelayWrite
Delay the TFile write (to reduce the number of write when reusing the file)
void SetMergeOptions(const TString &options)
virtual Bool_t PartialMerge(Int_t type=kAll|kIncremental)
Merge the files.
virtual void Reset()
Reset merger file list.
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...
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
A TMemFile is like a normal TFile except that it reads and writes only from memory.
@ kOverwrite
overwrite existing object with same name
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.