ROOT 6.10/09 Reference Guide |
TBufferMerger is a class to facilitate writing data in parallel from multiple threads, while writing to a single output file.
A TBufferMergerFile is similar to a TMemFile, but when data is written to it, it is appended to the TBufferMerger queue.
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.
The TBufferMerger merges all data into the output file on disk.
Definition at line 44 of file TBufferMerger.hxx.
Public Member Functions | |
TBufferMerger (const char *name, Option_t *option="RECREATE", Int_t compress=1) | |
Constructor. More... | |
virtual | ~TBufferMerger () |
Destructor. More... | |
std::shared_ptr< TBufferMergerFile > | GetFile () |
Returns a TBufferMergerFile to which data can be written. More... | |
Private Member Functions | |
TBufferMerger () | |
TBufferMerger has no default constructor. More... | |
TBufferMerger (const TBufferMerger &) | |
TBufferMerger has no copy constructor. More... | |
TBufferMerger & | operator= (const TBufferMerger &) |
TBufferMerger has no copy operator. More... | |
void | Push (TBufferFile *buffer) |
void | WriteOutputFile () |
Private Attributes | |
std::vector< std::weak_ptr< TBufferMergerFile > > | fAttachedFiles |
const Int_t | fCompress |
std::condition_variable | fDataAvailable |
std::unique_ptr< std::thread > | fMergingThread |
const std::string | fName |
const std::string | fOption |
std::queue< TBufferFile * > | fQueue |
std::mutex | fQueueMutex |
Friends | |
class | TBufferMergerFile |
#include <ROOT/TBufferMerger.hxx>
ROOT::Experimental::TBufferMerger::TBufferMerger | ( | const char * | name, |
Option_t * | option = "RECREATE" , |
||
Int_t | compress = 1 |
||
) |
Constructor.
name | Output file name |
option | Output file creation options |
ftitle | Output file title |
compression | Output file compression level |
Definition at line 23 of file TBufferMerger.cxx.
|
virtual |
Destructor.
Definition at line 29 of file TBufferMerger.cxx.
|
private |
TBufferMerger has no default constructor.
|
private |
TBufferMerger has no copy constructor.
std::shared_ptr< TBufferMergerFile > ROOT::Experimental::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 38 of file TBufferMerger.cxx.
|
private |
TBufferMerger has no copy operator.
|
private |
Definition at line 47 of file TBufferMerger.cxx.
|
private |
Definition at line 56 of file TBufferMerger.cxx.
|
friend |
Definition at line 69 of file TBufferMerger.hxx.
|
private |
Definition at line 91 of file TBufferMerger.hxx.
|
private |
Definition at line 86 of file TBufferMerger.hxx.
|
private |
Definition at line 88 of file TBufferMerger.hxx.
|
private |
Definition at line 90 of file TBufferMerger.hxx.
|
private |
Definition at line 84 of file TBufferMerger.hxx.
|
private |
Definition at line 85 of file TBufferMerger.hxx.
|
private |
Definition at line 89 of file TBufferMerger.hxx.
|
private |
Definition at line 87 of file TBufferMerger.hxx.