11#ifndef POOL_ROOTSTORAGESVC_ROOTDBASE_H
12#define POOL_ROOTSTORAGESVC_ROOTDBASE_H 1
15#include "GaudiKernel/SmartIF.h"
23#include <unordered_map>
26namespace ROOT {
class RNTupleReader; }
154 static bool exists(
const std::string& nam);
157 virtual long long int size()
const;
213 const std::string& nam,
APRMessaging(const std::string &name)
Description: Handle managing a DbDatabaseObj, a generic Database object.
Description: Definition an option to be supplied to database objects.
This class is highly inspired by the error code distribution system as it is used in DEC/VMS or MS/WN...
virtual DbStatus onOpen(DbDatabase &dbH, DbAccessMode mode)
Callback after successful open of a database object.
int m_defCompressionAlg
Default compression algorithm.
virtual long long int size() const
Access the size of the database: May be undefined for some technologies.
int m_rntReaderMetricsEnabled
Flag to enable/disable RNTupleReader metrics.
std::set< std::string > m_indexRebuilt
marks if the index (for index Containers) was rebuilt for given TTree
void markIndexRebuilt(const std::string &treeName)
Mark that a given TTree had its index rebuilt.
TTree * getTree(const std::string &name)
Get TTree by name from the TFile.
DbStatus markBranchContainerForFill(RootTreeContainer *)
long long int m_counters[3]
Counter statistics.
virtual DbStatus open(const DbDomain &domH, const std::string &nam, DbAccessMode mode)
Open Database object.
int m_defTreeCacheLearnEvents
Default tree cache learn events.
virtual DbStatus setOption(const DbOption &opt)
Set options.
std::string m_version
Persistency format version.
std::map< std::string, int > m_customSplitLevel
std::string m_indexMaster
name of the container with master index ('*' means use the biggest)
int m_rntBufferedWriteEnabled
Flag to enable/disable buffered RNTuple writing.
long long int byteCount(int which) const
Do some statistics: retrieve number of bytes read/written/other.
int m_defSplitLevel
Default split level.
TFile * file()
Access to the actual implemented file.
uint64_t m_indexMasterID
nextID of the master index
virtual DbStatus reopen(DbAccessMode mode)
Re-open database with changing access permissions.
virtual ~RootDatabase()
Standard destructor.
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.
ROOT::RNTupleReader * getNTupleReader(const std::string &ntuple_name)
return RNTupleReader for a given ntuple_name
SmartIF< IFileMgr > m_fileMgr
std::map< std::string, int > m_autoFlushTrees
std::map< std::string, std::unique_ptr< RootStorageSvc::RNTupleWriterHelper > > m_ntupleWriterMap
int m_defBufferSize
Default buffer size parameter for Branches.
int m_defCompression
Default compression level.
void reduceBasketsSize(TTree *tree)
DbDatabase m_dbH
Parent Database handle.
std::map< TBranch *, uint64_t > m_indexSizeMap
Keep index sizes here, because Branches are emptied when fast merged by SharedWriter.
uint64_t indexSizeInc(TBranch *branch)
increase index size counter for indexed containers (by 1)
bool wasIndexRebuilt(const std::string &treeName)
Check if a given TTree had its index rebuilt.
std::map< std::string, std::unique_ptr< ROOT::RNTupleReader > > m_ntupleReaderMap
int m_minBufferEntries
Minimum buffer entries parameter for Branches.
virtual DbStatus setAutoFlush(const DbOption &opt)
implementation of TREE_AUTO_FLUSH option - called from setOption()
void registerBranchContainer(RootTreeContainer *)
static bool exists(const std::string &nam)
Check for file-existence.
DbStatus fillBranchContainerTrees()
int m_rntWriterMetricsEnabled
Flag to enable/disable RNTupleWriter metrics.
virtual DbStatus getOption(DbOption &opt)
Access options.
int m_maxBufferSize
Maximum buffer size parameter for Branches.
TFile * m_file
Reference to the actual implemented file.
int m_defAutoSave
Default Autosave parameter for trees.
int m_branchOffsetTabLen
Offset table length for branches.
std::string name() const
Get the DB name (here it is the TFile name)
std::map< void *, indexLookup_t > m_ntupleIndexMap
void addByteCount(int which, long long int num_bytes)
Do some statistics: add number of bytes read/written/other.
virtual DbStatus transAct(Transaction::Action action)
Execute Database Transaction action.
std::set< RootTreeContainer * > ContainerSet_t
std::map< TTree *, ContainerSet_t > m_containersInTree
std::recursive_mutex & ioMutex()
provide access to the I/O mutex for AuxDynReader and Containers
void increaseBasketsSize(TTree *tree)
uint64_t indexLookup(ROOT::RNTupleReader *ps, uint64_t idx_val)
uint64_t indexSize(TBranch *branch)
get index size for indexed containers
const std::string & fmtVersion() const
Access to the version string.
virtual DbStatus close(DbAccessMode mode)
Close database access.
std::unordered_map< uint64_t, uint64_t > indexLookup_t
void printErrno(const char *nam, int err)
uint64_t currentIndexMasterID() const
std::recursive_mutex m_iomutex
RootDatabase()
Standard Constructor.
int m_defWritePolicy
Default policy mode for keyed objects.
std::string m_treeNameWithCache
Name of tree with cache.
Description: ROOT specific implementation of Database container.
Selection rules: declare transient members.
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.