TBufferMerger is a class to facilitate writing data in parallel from multiple threads, while writing to a single output file.
Its purpose is similar to TParallelMergingFile, but instead of using processes that connect to a network socket, TBufferMerger uses threads that each write to a TBufferMergerFile, which in turn push data into a queue managed by the TBufferMerger.
Definition at line 41 of file TBufferMerger.hxx.
Public Member Functions | |
TBufferMerger (const char *name, Option_t *option="RECREATE", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault) | |
Constructor. | |
TBufferMerger (std::unique_ptr< TFile > output) | |
Constructor. | |
virtual | ~TBufferMerger () |
Destructor. | |
_R__DEPRECATED_LATER ("The queuing mechanism in TBufferMerger was removed in ROOT v6.32") size_t GetAutoSave() const | |
_R__DEPRECATED_LATER ("The queuing mechanism in TBufferMerger was removed in ROOT v6.32") size_t GetBuffered() const | |
_R__DEPRECATED_LATER ("The queuing mechanism in TBufferMerger was removed in ROOT v6.32") size_t GetQueueSize() const | |
_R__DEPRECATED_LATER ("The queuing mechanism in TBufferMerger was removed in ROOT v6.32") void SetAutoSave(size_t) | |
_R__DEPRECATED_LATER ("The queuing mechanism in TBufferMerger was removed in ROOT v6.32") void SetCompressTemporaryKeys(Bool_t | |
std::shared_ptr< TBufferMergerFile > | GetFile () |
Returns a TBufferMergerFile to which data can be written. | |
const char * | GetMergeOptions () |
Returns the current merge options. | |
Bool_t | GetNotrees () const |
Returns whether the file has been marked as not containing any TTree objects and thus that steps that are specific to TTree can be skipped. | |
void | SetMergeOptions (const TString &options) |
Sets the merge options. | |
void | SetNotrees (Bool_t notrees=kFALSE) |
Indicates that any TTree objects in the file should be skipped and thus that steps that are specific to TTree can be skipped. | |
Private Member Functions | |
TBufferMerger () | |
TBufferMerger has no default constructor. | |
TBufferMerger (const TBufferMerger &) | |
TBufferMerger has no copy constructor. | |
void | Init (std::unique_ptr< TFile >) |
void | Merge (TBufferMergerFile *memfile) |
TBufferMerger & | operator= (const TBufferMerger &) |
TBufferMerger has no copy operator. | |
Private Attributes | |
std::vector< std::weak_ptr< TBufferMergerFile > > | fAttachedFiles |
std::mutex | fMergeMutex |
TFileMerger | fMerger {false, false} |
#include <ROOT/TBufferMerger.hxx>
ROOT::TBufferMerger::TBufferMerger | ( | const char * | name, |
Option_t * | option = "RECREATE" , |
||
Int_t | compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault |
||
) |
Constructor.
name | Output file name |
option | Output file creation options |
compress | Output file compression level |
Definition at line 23 of file TBufferMerger.cxx.
ROOT::TBufferMerger::TBufferMerger | ( | std::unique_ptr< TFile > | output | ) |
|
virtual |
Destructor.
Definition at line 44 of file TBufferMerger.cxx.
|
private |
TBufferMerger has no default constructor.
|
private |
TBufferMerger has no copy constructor.
|
inline |
Definition at line 77 of file TBufferMerger.hxx.
|
inline |
Definition at line 74 of file TBufferMerger.hxx.
|
inline |
Definition at line 71 of file TBufferMerger.hxx.
|
inline |
Definition at line 83 of file TBufferMerger.hxx.
ROOT::TBufferMerger::_R__DEPRECATED_LATER | ( | "The queuing mechanism in TBufferMerger was removed in ROOT v6.32" | ) |
std::shared_ptr< TBufferMergerFile > ROOT::TBufferMerger::GetFile | ( | ) |
Returns a TBufferMergerFile to which data can be written.
At the end, all TBufferMergerFiles get merged into the output file. The user is responsible to "cd" into the file to associate objects such as histograms or trees to it.
After the creation of this file, the user must reset the kMustCleanup bit on any objects attached to it and take care of their deletion, as there is a possibility that a race condition will happen that causes a crash if ROOT manages these objects.
Definition at line 56 of file TBufferMerger.cxx.
const char * ROOT::TBufferMerger::GetMergeOptions | ( | ) |
Returns the current merge options.
Definition at line 65 of file TBufferMerger.cxx.
|
inline |
Returns whether the file has been marked as not containing any TTree objects and thus that steps that are specific to TTree can be skipped.
Definition at line 102 of file TBufferMerger.hxx.
|
private |
Definition at line 36 of file TBufferMerger.cxx.
|
private |
Definition at line 76 of file TBufferMerger.cxx.
|
private |
TBufferMerger has no copy operator.
void ROOT::TBufferMerger::SetMergeOptions | ( | const TString & | options | ) |
Sets the merge options.
SetMergeOptions("fast") will disable recompression of input data into the output if they have different compression settings.
options | TFileMerger/TFileMergeInfo merge options |
Definition at line 71 of file TBufferMerger.cxx.
Indicates that any TTree objects in the file should be skipped and thus that steps that are specific to TTree can be skipped.
Definition at line 95 of file TBufferMerger.hxx.
|
private |
Definition at line 131 of file TBufferMerger.hxx.
|
private |
Definition at line 130 of file TBufferMerger.hxx.
|
private |
Definition at line 129 of file TBufferMerger.hxx.