Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::TBufferMerger Class Reference

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< TBufferMergerFileGetFile ()
 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)
 
TBufferMergeroperator= (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>

Constructor & Destructor Documentation

◆ TBufferMerger() [1/4]

ROOT::TBufferMerger::TBufferMerger ( const char *  name,
Option_t option = "RECREATE",
Int_t  compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault 
)

Constructor.

Parameters
nameOutput file name
optionOutput file creation options
compressOutput file compression level

Definition at line 23 of file TBufferMerger.cxx.

◆ TBufferMerger() [2/4]

ROOT::TBufferMerger::TBufferMerger ( std::unique_ptr< TFile output)

Constructor.

Parameters
outputOutput TFile

Definition at line 31 of file TBufferMerger.cxx.

◆ ~TBufferMerger()

ROOT::TBufferMerger::~TBufferMerger ( )
virtual

Destructor.

Definition at line 44 of file TBufferMerger.cxx.

◆ TBufferMerger() [3/4]

ROOT::TBufferMerger::TBufferMerger ( )
private

TBufferMerger has no default constructor.

◆ TBufferMerger() [4/4]

ROOT::TBufferMerger::TBufferMerger ( const TBufferMerger )
private

TBufferMerger has no copy constructor.

Member Function Documentation

◆ _R__DEPRECATED_LATER() [1/5]

ROOT::TBufferMerger::_R__DEPRECATED_LATER ( "The queuing mechanism in TBufferMerger was removed in ROOT v6.32"  ) const
inline

Definition at line 77 of file TBufferMerger.hxx.

◆ _R__DEPRECATED_LATER() [2/5]

ROOT::TBufferMerger::_R__DEPRECATED_LATER ( "The queuing mechanism in TBufferMerger was removed in ROOT v6.32"  ) const
inline

Definition at line 74 of file TBufferMerger.hxx.

◆ _R__DEPRECATED_LATER() [3/5]

ROOT::TBufferMerger::_R__DEPRECATED_LATER ( "The queuing mechanism in TBufferMerger was removed in ROOT v6.32"  ) const
inline

Definition at line 71 of file TBufferMerger.hxx.

◆ _R__DEPRECATED_LATER() [4/5]

ROOT::TBufferMerger::_R__DEPRECATED_LATER ( "The queuing mechanism in TBufferMerger was removed in ROOT v6.32"  )
inline

Definition at line 83 of file TBufferMerger.hxx.

◆ _R__DEPRECATED_LATER() [5/5]

ROOT::TBufferMerger::_R__DEPRECATED_LATER ( "The queuing mechanism in TBufferMerger was removed in ROOT v6.32"  )

◆ GetFile()

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.

◆ GetMergeOptions()

const char * ROOT::TBufferMerger::GetMergeOptions ( )

Returns the current merge options.

Definition at line 65 of file TBufferMerger.cxx.

◆ GetNotrees()

Bool_t ROOT::TBufferMerger::GetNotrees ( ) const
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.

◆ Init()

void ROOT::TBufferMerger::Init ( std::unique_ptr< TFile output)
private

Definition at line 36 of file TBufferMerger.cxx.

◆ Merge()

void ROOT::TBufferMerger::Merge ( ROOT::TBufferMergerFile memfile)
private

Definition at line 76 of file TBufferMerger.cxx.

◆ operator=()

TBufferMerger & ROOT::TBufferMerger::operator= ( const TBufferMerger )
private

TBufferMerger has no copy operator.

◆ SetMergeOptions()

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.

Parameters
optionsTFileMerger/TFileMergeInfo merge options

Definition at line 71 of file TBufferMerger.cxx.

◆ SetNotrees()

void ROOT::TBufferMerger::SetNotrees ( Bool_t  notrees = kFALSE)
inline

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.

Member Data Documentation

◆ fAttachedFiles

std::vector<std::weak_ptr<TBufferMergerFile> > ROOT::TBufferMerger::fAttachedFiles
private

Definition at line 131 of file TBufferMerger.hxx.

◆ fMergeMutex

std::mutex ROOT::TBufferMerger::fMergeMutex
private

Definition at line 130 of file TBufferMerger.hxx.

◆ fMerger

TFileMerger ROOT::TBufferMerger::fMerger {false, false}
private

Definition at line 129 of file TBufferMerger.hxx.

Libraries for ROOT::TBufferMerger:

The documentation for this class was generated from the following files: