4#ifndef ROOTSTORAGESVC_ROOTDBASE_H
5#define ROOTSTORAGESVC_ROOTDBASE_H 1
9#include "GaudiKernel/SmartIF.h"
15#include "ROOT/RNTupleReader.hxx"
21#include <unordered_map>
143 static bool exists(
const std::string& nam);
146 virtual long long int size()
const;
201 const std::string& nam,
209 virtual StatusCode
close(Io::IoFlag mode);
Maintain a set of objects, one per slot.
APRMessaging(const std::string &name)
Description: Handle managing a DbDatabaseObj, a generic Database object.
Description: Definition an option to be supplied to database objects.
Description: Interface to the technology specific implementation of a Database object.
virtual StatusCode open(const DbDatabase &dbH, const std::string &nam, Io::IoFlag mode)
Open Database object.
virtual StatusCode close(Io::IoFlag mode)
Close database access.
std::optional< SG::SlotSpecificObj< std::unique_ptr< ROOT::RNTupleReader::RActiveEntryToken > > > m_activeEntryTokenPtr
std::recursive_mutex m_iomutex
int m_defCompression
Default compression level.
int m_minBufferEntries
Minimum buffer entries parameter for Branches.
int m_rntBufferedWriteEnabled
Flag to enable/disable buffered RNTuple writing.
std::map< TBranch *, uint64_t > m_indexSizeMap
Keep index sizes here, because Branches are emptied when fast merged by SharedWriter.
long long int byteCount(int which) const
Do some statistics: retrieve number of bytes read/written/other.
void addByteCount(int which, long long int num_bytes)
Do some statistics: add number of bytes read/written/other.
ROOT::RNTupleReader * getNTupleReader(const std::string &ntuple_name)
return RNTupleReader for a given ntuple_name
uint64_t indexSize(TBranch *branch)
get index size for indexed containers
void increaseBasketsSize(TTree *tree)
std::map< void *, indexLookup_t > m_ntupleIndexMap
void registerBranchContainer(RootTreeContainer *)
StatusCode fillBranchContainerTrees()
int m_rntWriterMetricsEnabled
Flag to enable/disable RNTupleWriter metrics.
std::map< std::string, std::unique_ptr< ROOT::RNTupleReader > > m_ntupleReaderMap
int m_defSplitLevel
Default split level.
std::set< std::string > m_indexRebuilt
marks if the index (for index Containers) was rebuilt for given TTree
DbDatabase m_dbH
Parent Database handle.
RootDatabase()
Standard Constructor.
static bool exists(const std::string &nam)
Check for file-existence.
uint64_t currentIndexMasterID() const
TFile * m_file
Reference to the actual implemented file.
uint64_t indexLookup(ROOT::RNTupleReader *ps, uint64_t idx_val)
std::string m_treeNameWithCache
Name of tree with cache.
virtual StatusCode transAct(Transaction::Action action)
Execute Database Transaction action.
std::map< std::string, std::unique_ptr< RootStorageSvc::RNTupleWriterHelper > > m_ntupleWriterMap
int m_branchOffsetTabLen
Offset table length for branches.
RootStorageSvc::RNTupleWriterHelper * getNTupleWriter(const std::string &ntuple_name, bool create=false)
Return RNTupleWriterHelper for a given ntuple_name create a new one if needed when create==true.
std::string m_indexMaster
name of the container with master index ('*' means use the biggest)
TTree * getTree(const std::string &name)
Get TTree by name from the TFile.
long long int m_counters[3]
Counter statistics.
TFile * file()
Access to the actual implemented file.
int m_defCompressionAlg
Default compression algorithm.
int m_rntReaderMetricsEnabled
Flag to enable/disable RNTupleReader metrics.
bool wasIndexRebuilt(const std::string &treeName)
Check if a given TTree had its index rebuilt.
virtual StatusCode setOption(const DbOption &opt)
Set options.
int m_maxBufferSize
Maximum buffer size parameter for Branches.
std::map< std::string, int > m_customSplitLevel
std::map< TTree *, ContainerSet_t > m_containersInTree
virtual StatusCode setAutoFlush(const DbOption &opt)
implementation of TREE_AUTO_FLUSH option - called from setOption()
virtual StatusCode getOption(DbOption &opt)
Access options.
void printErrno(const char *nam, int err)
void reduceBasketsSize(TTree *tree)
std::recursive_mutex & ioMutex()
provide access to the I/O mutex for AuxDynReader and Containers
int m_defBufferSize
Default buffer size parameter for Branches.
uint64_t indexSizeInc(TBranch *branch)
increase index size counter for indexed containers (by 1)
std::map< std::string, int > m_autoFlushTrees
std::set< RootTreeContainer * > ContainerSet_t
virtual ~RootDatabase()
Standard destructor.
void markIndexRebuilt(const std::string &treeName)
Mark that a given TTree had its index rebuilt.
StatusCode markBranchContainerForFill(RootTreeContainer *)
virtual long long int size() const
Access the size of the database: May be undefined for some technologies.
int m_defAutoSave
Default Autosave parameter for trees.
std::unordered_map< uint64_t, uint64_t > indexLookup_t
int m_defWritePolicy
Default policy mode for keyed objects.
std::string name() const
Get the DB name (here it is the TFile name).
uint64_t m_indexMasterID
nextID of the master index
std::string m_rntUnsplitFieldList
Comma separated list of unsplit field patterns for RNTupleWriter.
SmartIF< IFileMgr > m_fileMgr
Description: ROOT specific implementation of Database container.
::StatusCode StatusCode
StatusCode definition for legacy code.
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.