The Gaudi Framework  v33r1 (b1225454)
EvtStoreSvc Class Reference

Use a minimal event store implementation, and adds everything required to satisfy the IDataProviderSvc, IDataManagerSvc and IHiveWhiteBoard interfaces by throwing exceptions except when the functionality is really needed... More...

Inheritance diagram for EvtStoreSvc:
Collaboration diagram for EvtStoreSvc:

Public Member Functions

CLID rootCLID () const override
 
const std::stringrootName () const override
 
StatusCode setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc) override
 
size_t allocateStore (int evtnumber) override
 Allocate a store partition for a given event number. More...
 
StatusCode freeStore (size_t partition) override
 Free a store partition. More...
 
size_t freeSlots () override
 
StatusCode selectStore (size_t partition) override
 Activate a partition object. The identifies the partition uniquely. More...
 
StatusCode clearStore () override
 
StatusCode clearStore (size_t partition) override
 Remove all data objects in one 'slot' of the data store. More...
 
StatusCode setNumberOfStores (size_t slots) override
 Set the number of event slots (copies of DataSvc objects). More...
 
size_t getNumberOfStores () const override
 
size_t getPartitionNumber (int eventnumber) const override
 Get the partition number corresponding to a given event. More...
 
bool exists (const DataObjID &id) override
 
StatusCode objectParent (const DataObject *, IRegistry *&) override
 
StatusCode objectParent (const IRegistry *, IRegistry *&) override
 
StatusCode objectLeaves (const DataObject *, std::vector< IRegistry * > &) override
 
StatusCode objectLeaves (const IRegistry *, std::vector< IRegistry * > &) override
 
StatusCode clearSubTree (std::string_view) override
 
StatusCode clearSubTree (DataObject *obj) override
 
StatusCode traverseSubTree (std::string_view, IDataStoreAgent *) override
 
StatusCode traverseSubTree (DataObject *obj, IDataStoreAgent *pAgent) override
 
StatusCode traverseTree (IDataStoreAgent *pAgent) override
 
StatusCode setRoot (std::string root_name, DataObject *pObject) override
 
StatusCode setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
 
StatusCode unregisterAddress (std::string_view) override
 
StatusCode unregisterAddress (IRegistry *, std::string_view) override
 
StatusCode registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress) override
 
StatusCode registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress) override
 
StatusCode registerObject (std::string_view parentPath, std::string_view objectPath, DataObject *pObject) override
 
StatusCode registerObject (DataObject *parentObj, std::string_view objectPath, DataObject *pObject) override
 
StatusCode unregisterObject (std::string_view) override
 
StatusCode unregisterObject (DataObject *obj) override
 
StatusCode unregisterObject (DataObject *obj, std::string_view sr) override
 
StatusCode retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 
StatusCode findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 
StatusCode findObject (std::string_view fullPath, DataObject *&pObject) override
 
StatusCode updateObject (IRegistry *) override
 
StatusCode updateObject (DataObject *) override
 
StatusCode addPreLoadItem (const DataStoreItem &) override
 
StatusCode removePreLoadItem (const DataStoreItem &) override
 
StatusCode resetPreLoad () override
 
StatusCode preLoad () override
 
StatusCode linkObject (IRegistry *, std::string_view, DataObject *) override
 
StatusCode linkObject (std::string_view, DataObject *) override
 
StatusCode unlinkObject (IRegistry *, std::string_view) override
 
StatusCode unlinkObject (DataObject *, std::string_view) override
 
StatusCode unlinkObject (std::string_view) override
 
StatusCode initialize () override
 
StatusCode finalize () override
 
- Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from Service
const std::stringname () const override
 Retrieve name of the service. More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service. More...
 
StatusCode sysStart () override
 Initialize Service. More...
 
StatusCode sysStop () override
 Initialize Service. More...
 
StatusCode sysFinalize () override
 Finalize Service. More...
 
StatusCode sysReinitialize () override
 Re-initialize the Service. More...
 
StatusCode sysRestart () override
 Re-initialize the Service. More...
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p) override
 set the property form another property More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 set the property from name and the value More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (const std::string &name) const override
 get the property by name More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (const std::string &name) const override
 Return true if we have a property with the given name. More...
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 

Private Member Functions

std::size_t poolSize () const
 
void fillStats (Partition &p) const
 
void initStore (Partition &p) const
 

Private Attributes

Gaudi::Property< CLIDm_rootCLID {this, "RootCLID", 110 , "CLID of root entry"}
 
Gaudi::Property< std::stringm_rootName {this, "RootName", "/Event", "name of root entry"}
 
Gaudi::Property< bool > m_forceLeaves {this, "ForceLeaves", false, "force creation of default leaves on registerObject"}
 
Gaudi::Property< std::stringm_loader {this, "DataLoader", "EventPersistencySvc"}
 
Gaudi::Property< size_t > m_slots {this, "EventSlots", 1, "number of event slots"}
 
Gaudi::Property< bool > m_printPoolStats {this, "PrintPoolStats", false, "Print memory pool statistics"}
 
Gaudi::Property< std::size_tm_poolSize {this, "PoolSize", 1024, "Initial per-event memory pool size [KiB]"}
 
Gaudi::Property< std::size_tm_estStoreBuckets {this, "StoreBuckets", 100, "Estimated number of buckets in the store"}
 
Gaudi::Accumulators::AveragingCounter< std::size_tm_usedPoolSize
 
Gaudi::Accumulators::AveragingCounter< std::size_tm_servedPoolAllocations
 
Gaudi::Accumulators::AveragingCounter< std::size_tm_usedPoolAllocations
 
Gaudi::Accumulators::AveragingCounter< std::size_tm_storeEntries
 
Gaudi::Accumulators::AveragingCounter< std::size_tm_storeBuckets
 
SmartIF< IConversionSvcm_dataLoader
 
std::vector< DataStoreItemm_preLoads
 Items to be pre-loaded. More...
 
std::vector< Synced< Partition > > m_partitions
 The actual store(s) More...
 
tbb::concurrent_queue< size_t > m_freeSlots
 
Gaudi::Property< std::vector< std::string > > m_inhibitPrefixes
 
Gaudi::Property< bool > m_followLinksToAncestors
 
std::string_view m_onlyThisID
 

Additional Inherited Members

- Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Member Functions inherited from Service
 ~Service () override
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBaseproperty (const std::string &name) const
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::Property< int > m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
 
Gaudi::Property< bool > m_auditInit {this, "AuditServices", false, " unused"}
 
Gaudi::Property< bool > m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
 
Gaudi::Property< bool > m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
 
Gaudi::Property< bool > m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
 
Gaudi::Property< bool > m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
 
Gaudi::Property< bool > m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
 
Gaudi::Property< bool > m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. More...
 

Detailed Description

Use a minimal event store implementation, and adds everything required to satisfy the IDataProviderSvc, IDataManagerSvc and IHiveWhiteBoard interfaces by throwing exceptions except when the functionality is really needed...

Author
Gerhard Raven
Version
1.0

Definition at line 248 of file EvtStoreSvc.cpp.

Member Function Documentation

◆ addPreLoadItem()

StatusCode EvtStoreSvc::addPreLoadItem ( const DataStoreItem item)
override

Definition at line 665 of file EvtStoreSvc.cpp.

665  {
666  auto i = std::find( m_preLoads.begin(), m_preLoads.begin(), item );
667  if ( i == m_preLoads.end() ) m_preLoads.push_back( item );
668  return StatusCode::SUCCESS;
669 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
T end(T... args)
T push_back(T... args)
T find(T... args)
T begin(T... args)

◆ allocateStore()

size_t EvtStoreSvc::allocateStore ( int  evtnumber)
override

Allocate a store partition for a given event number.

Definition at line 430 of file EvtStoreSvc.cpp.

430  {
431  // take next free slot in the list
432  size_t slot = std::string::npos;
433  if ( m_freeSlots.try_pop( slot ) ) {
434  assert( slot != std::string::npos );
435  assert( slot < m_partitions.size() );
436  [[maybe_unused]] auto prev = m_partitions[slot].with_lock(
437  [evtnumber]( Partition& p ) { return std::exchange( p.eventNumber, evtnumber ); } );
438  assert( prev == -1 ); // or whatever value represents 'free'
439  }
440  return slot;
441 }
tbb::concurrent_queue< size_t > m_freeSlots
T prev(T... args)
std::vector< Synced< Partition > > m_partitions
The actual store(s)
T size(T... args)

◆ clearStore() [1/2]

StatusCode EvtStoreSvc::clearStore ( )
override

Definition at line 491 of file EvtStoreSvc.cpp.

491  {
492  m_onlyThisID = {};
493  return fwd( [this]( Partition& p ) {
494  fillStats( p );
495  initStore( p ); // replace with a clean store
496  return StatusCode::SUCCESS;
497  } );
498 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::string_view m_onlyThisID
void initStore(Partition &p) const
void fillStats(Partition &p) const

◆ clearStore() [2/2]

StatusCode EvtStoreSvc::clearStore ( size_t  partition)
override

Remove all data objects in one 'slot' of the data store.

Definition at line 476 of file EvtStoreSvc.cpp.

476  {
477  m_onlyThisID = {};
478  return m_partitions[partition].with_lock( [this]( Partition& p ) {
479  fillStats( p );
480  initStore( p ); // replace with a clean store
481  return StatusCode::SUCCESS;
482  } );
483 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
T partition(T... args)
std::vector< Synced< Partition > > m_partitions
The actual store(s)
std::string_view m_onlyThisID
void initStore(Partition &p) const
void fillStats(Partition &p) const

◆ clearSubTree() [1/2]

StatusCode EvtStoreSvc::clearSubTree ( std::string_view  top)
override

Definition at line 484 of file EvtStoreSvc.cpp.

484  {
485  top = normalize_path( top, rootName() );
486  return fwd( [&]( Partition& p ) {
487  p.store->erase_if( [top]( const auto& value ) { return boost::algorithm::starts_with( value.first, top ); } );
488  return StatusCode::SUCCESS;
489  } );
490 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
const std::string & rootName() const override

◆ clearSubTree() [2/2]

StatusCode EvtStoreSvc::clearSubTree ( DataObject obj)
inlineoverride

Definition at line 331 of file EvtStoreSvc.cpp.

331  {
332  return obj && obj->registry() ? clearSubTree( obj->registry()->identifier() ) : StatusCode::FAILURE;
333  }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:82
StatusCode clearSubTree(std::string_view) override
constexpr static const auto FAILURE
Definition: StatusCode.h:101
virtual const id_type & identifier() const =0
Full identifier (or key)

◆ exists()

bool EvtStoreSvc::exists ( const DataObjID id)
inlineoverride

Definition at line 320 of file EvtStoreSvc.cpp.

320  {
321  DataObject* pObject{nullptr};
322  return findObject( id.fullKey(), pObject ).isSuccess();
323  }
bool isSuccess() const
Definition: StatusCode.h:365
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:40
StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override

◆ fillStats()

void EvtStoreSvc::fillStats ( Partition &  p) const
inlineprivate

Definition at line 263 of file EvtStoreSvc.cpp.

263  {
264  if ( LIKELY( !m_printPoolStats ) ) return;
265  auto n_allocs = p.store->num_allocations();
266  if ( n_allocs ) {
267  m_storeEntries += p.store->size();
268  m_usedPoolSize += p.store->used_bytes();
269  m_storeBuckets += p.store->used_buckets();
270  m_usedPoolAllocations += p.store->used_blocks();
271  m_servedPoolAllocations += n_allocs;
272  }
273  }
Gaudi::Accumulators::AveragingCounter< std::size_t > m_storeBuckets
Gaudi::Accumulators::AveragingCounter< std::size_t > m_storeEntries
Gaudi::Accumulators::AveragingCounter< std::size_t > m_servedPoolAllocations
Gaudi::Accumulators::AveragingCounter< std::size_t > m_usedPoolAllocations
#define LIKELY(x)
Definition: Kernel.h:105
Gaudi::Property< bool > m_printPoolStats
Gaudi::Accumulators::AveragingCounter< std::size_t > m_usedPoolSize

◆ finalize()

StatusCode EvtStoreSvc::finalize ( )
inlineoverride

Definition at line 406 of file EvtStoreSvc.cpp.

406  {
407  if ( m_printPoolStats ) {
408  info() << "Mean memory pool usage: " << float( 1e-3f * m_usedPoolSize.mean() ) << " KiB serving "
409  << float( m_servedPoolAllocations.mean() ) << " allocations from " << float( m_usedPoolAllocations.mean() )
410  << " to produce " << float( m_storeEntries.mean() ) << " entries in " << float( m_storeBuckets.mean() )
411  << " buckets" << endmsg;
412  }
413  setDataLoader( nullptr, nullptr ).ignore(); // release
414  return extends::finalize();
415  }
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc) override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Gaudi::Accumulators::AveragingCounter< std::size_t > m_storeBuckets
Gaudi::Accumulators::AveragingCounter< std::size_t > m_storeEntries
Gaudi::Accumulators::AveragingCounter< std::size_t > m_servedPoolAllocations
Gaudi::Accumulators::AveragingCounter< std::size_t > m_usedPoolAllocations
Gaudi::Property< bool > m_printPoolStats
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
Gaudi::Accumulators::AveragingCounter< std::size_t > m_usedPoolSize
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ findObject() [1/2]

StatusCode EvtStoreSvc::findObject ( IRegistry pDirectory,
std::string_view  path,
DataObject *&  pObject 
)
override

Definition at line 656 of file EvtStoreSvc.cpp.

656  {
657  return retrieveObject( pDirectory, path, pObject );
658 }
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override

◆ findObject() [2/2]

StatusCode EvtStoreSvc::findObject ( std::string_view  fullPath,
DataObject *&  pObject 
)
override

Definition at line 659 of file EvtStoreSvc.cpp.

659  {
660  return retrieveObject( nullptr, fullPath, pObject );
661 }
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override

◆ freeSlots()

size_t EvtStoreSvc::freeSlots ( )
inlineoverride

Definition at line 313 of file EvtStoreSvc.cpp.

313 { return m_freeSlots.unsafe_size(); }
tbb::concurrent_queue< size_t > m_freeSlots

◆ freeStore()

StatusCode EvtStoreSvc::freeStore ( size_t  partition)
override

Free a store partition.

Definition at line 468 of file EvtStoreSvc.cpp.

468  {
469  assert( partition < m_partitions.size() );
470  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
471  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
472  m_freeSlots.push( partition );
473  return StatusCode::SUCCESS;
474 }
#define UNLIKELY(x)
Definition: Kernel.h:106
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
tbb::concurrent_queue< size_t > m_freeSlots
T partition(T... args)
T prev(T... args)
std::vector< Synced< Partition > > m_partitions
The actual store(s)
T size(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ getNumberOfStores()

size_t EvtStoreSvc::getNumberOfStores ( ) const
inlineoverride

Definition at line 318 of file EvtStoreSvc.cpp.

318 { return m_slots; }
Gaudi::Property< size_t > m_slots

◆ getPartitionNumber()

size_t EvtStoreSvc::getPartitionNumber ( int  eventnumber) const
override

Get the partition number corresponding to a given event.

Definition at line 457 of file EvtStoreSvc.cpp.

457  {
459  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
460  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
461 }
T distance(T... args)
STL namespace.
std::vector< Synced< Partition > > m_partitions
The actual store(s)
def end
Definition: IOTest.py:123
T find_if(T... args)
AttribStringParser::Iterator begin(const AttribStringParser &parser)

◆ initialize()

StatusCode EvtStoreSvc::initialize ( )
inlineoverride

Definition at line 384 of file EvtStoreSvc.cpp.

384  {
385  Entry::setDataProviderSvc( this );
386  extends::initialize().ignore();
387  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
388  error() << "Cannot set number of slots" << endmsg;
389  return StatusCode::FAILURE;
390  }
392  // m_partitions is now full of empty std::optionals, fill them now.
393  for ( auto& synced_p : m_partitions ) {
394  synced_p.with_lock( [this]( Partition& p ) { initStore( p ); } );
395  }
396  for ( size_t i = 0; i < m_slots; i++ ) { m_freeSlots.push( i ); }
397  selectStore( 0 ).ignore();
398 
400  if ( !loader ) {
401  error() << "Cannot get IConversionSvc " << m_loader.value() << endmsg;
402  return StatusCode::FAILURE;
403  }
404  return setDataLoader( loader, nullptr );
405  }
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc) override
tbb::concurrent_queue< size_t > m_freeSlots
Gaudi::Property< std::string > m_loader
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Gaudi::Property< size_t > m_slots
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
std::vector< Synced< Partition > > m_partitions
The actual store(s)
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
STL class.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
void initStore(Partition &p) const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ initStore()

void EvtStoreSvc::initStore ( Partition &  p) const
inlineprivate

Definition at line 275 of file EvtStoreSvc.cpp.

275  {
276  if ( p.store ) {
277  // re-use the existing memory pool
278  p.store->reset();
279  } else {
280  p.store.emplace( m_estStoreBuckets, poolSize() );
281  }
282  }
std::size_t poolSize() const
Gaudi::Property< std::size_t > m_estStoreBuckets

◆ linkObject() [1/2]

StatusCode EvtStoreSvc::linkObject ( IRegistry ,
std::string_view  ,
DataObject  
)
inlineoverride

Definition at line 378 of file EvtStoreSvc.cpp.

378 { return dummy( __FUNCTION__ ); }

◆ linkObject() [2/2]

StatusCode EvtStoreSvc::linkObject ( std::string_view  ,
DataObject  
)
inlineoverride

Definition at line 379 of file EvtStoreSvc.cpp.

379 { return dummy( __FUNCTION__ ); }

◆ objectLeaves() [1/2]

StatusCode EvtStoreSvc::objectLeaves ( const DataObject ,
std::vector< IRegistry * > &   
)
inlineoverride

Definition at line 327 of file EvtStoreSvc.cpp.

327 { return dummy( __FUNCTION__ ); }

◆ objectLeaves() [2/2]

StatusCode EvtStoreSvc::objectLeaves ( const IRegistry ,
std::vector< IRegistry * > &   
)
inlineoverride

Definition at line 328 of file EvtStoreSvc.cpp.

328 { return dummy( __FUNCTION__ ); }

◆ objectParent() [1/2]

StatusCode EvtStoreSvc::objectParent ( const DataObject ,
IRegistry *&   
)
inlineoverride

Definition at line 325 of file EvtStoreSvc.cpp.

325 { return dummy( __FUNCTION__ ); }

◆ objectParent() [2/2]

StatusCode EvtStoreSvc::objectParent ( const IRegistry ,
IRegistry *&   
)
inlineoverride

Definition at line 326 of file EvtStoreSvc.cpp.

326 { return dummy( __FUNCTION__ ); }

◆ poolSize()

std::size_t EvtStoreSvc::poolSize ( ) const
inlineprivate

Definition at line 261 of file EvtStoreSvc.cpp.

261 { return m_poolSize * 1024; }
Gaudi::Property< std::size_t > m_poolSize

◆ preLoad()

StatusCode EvtStoreSvc::preLoad ( )
override

Definition at line 675 of file EvtStoreSvc.cpp.

675  {
676  for ( const auto& i : m_preLoads ) {
677  DataObject* pObj;
678  if ( msgLevel( MSG::DEBUG ) ) debug() << "Preloading " << i.path() << endmsg;
679  retrieveObject( nullptr, i.path(), pObj ).ignore();
680  }
681  return StatusCode::SUCCESS;
682 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:40
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ registerAddress() [1/2]

StatusCode EvtStoreSvc::registerAddress ( std::string_view  fullPath,
IOpaqueAddress pAddress 
)
override

Definition at line 560 of file EvtStoreSvc.cpp.

560  {
561  return registerAddress( nullptr, path, pAddr );
562 }
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override

◆ registerAddress() [2/2]

StatusCode EvtStoreSvc::registerAddress ( IRegistry parentObj,
std::string_view  objectPath,
IOpaqueAddress pAddress 
)
override

Definition at line 563 of file EvtStoreSvc.cpp.

563  {
564  auto addr = std::unique_ptr<IOpaqueAddress>( pAddr );
565  if ( !addr ) return Status::INVALID_OBJ_ADDR; // Precondition: Address must be valid
566  if ( msgLevel( MSG::DEBUG ) ) {
567  debug() << "registerAddress( (IRegistry*)" << (void*)pReg << ", " << path << ", (IOpaqueAddress*)" << addr.get()
568  << "[ " << addr->par()[0] << ", " << addr->par()[1] << " ]"
569  << " )" << endmsg;
570  }
571  if ( path.empty() || path[0] != '/' ) return StatusCode::FAILURE;
572  if ( !m_onlyThisID.empty() && addr->par()[0] != m_onlyThisID ) {
573  if ( msgLevel( MSG::DEBUG ) )
574  debug() << "Attempt to load " << addr->par()[1] << " from file " << addr->par()[0] << " blocked -- different file"
575  << endmsg;
576  return StatusCode::SUCCESS;
577  }
578  if ( std::any_of( m_inhibitPrefixes.begin(), m_inhibitPrefixes.end(),
579  [addrPath = addr->par()[1]]( std::string_view prefix ) {
580  return boost::algorithm::starts_with( addrPath, prefix );
581  } ) ) {
582  if ( msgLevel( MSG::DEBUG ) )
583  debug() << "Attempt to load " << addr->par()[1] << " from file " << addr->par()[0] << " blocked -- path inhibited"
584  << endmsg;
585  return StatusCode::SUCCESS;
586  }
587 
588  auto object = createObj( *m_dataLoader, *addr ); // Call data loader
589  if ( !object ) return Status::INVALID_OBJECT;
590  auto fullpath = ( pReg ? pReg->identifier() : m_rootName.value() ) + std::string{path};
591  // the data loader expects the path _including_ the root
592  LocalArena dummy_arena{fullpath.size() + 1};
593  auto dummy = Entry{fullpath, {}, {}, &dummy_arena};
594  object->setRegistry( &dummy );
595  addr->setRegistry( &dummy );
596  auto status = m_dataLoader->fillObjRefs( addr.get(), object.get() );
597  if ( !status.isSuccess() ) return status;
598  // note: put will overwrite the registry in pObject to point at the
599  // one actually used -- so we do not dangle, pointing at dummy beyond its
600  // lifetime
601  if ( msgLevel( MSG::DEBUG ) ) {
602  auto ptr = object.get();
603  debug() << "registerAddress: " << std::quoted( normalize_path( fullpath, rootName() ) ) << " (DataObject*)"
604  << static_cast<void*>( ptr ) << ( ptr ? " -> " + System::typeinfoName( typeid( *ptr ) ) : std::string{} )
605  << endmsg;
606  }
607  fwd( [&]( Partition& p ) {
608  p.store->put( normalize_path( fullpath, rootName() ), std::move( object ), std::move( addr ) );
609  return StatusCode::SUCCESS;
610  } ).ignore();
611  return status;
612 }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
SmartIF< IConversionSvc > m_dataLoader
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
STL namespace.
Gaudi::Property< std::string > m_rootName
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
STL class.
string prefix
Definition: gaudirun.py:343
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
T move(T... args)
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
STL class.
std::string_view m_onlyThisID
T any_of(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
Gaudi::Property< std::vector< std::string > > m_inhibitPrefixes
const std::string & rootName() const override

◆ registerObject() [1/2]

StatusCode EvtStoreSvc::registerObject ( std::string_view  parentPath,
std::string_view  objectPath,
DataObject pObject 
)
override

Definition at line 613 of file EvtStoreSvc.cpp.

614  {
615  return parentPath.empty()
616  ? registerObject( nullptr, objectPath, pObject )
617  : registerObject( nullptr, std::string{parentPath}.append( "/" ).append( objectPath ), pObject );
618 }
STL namespace.
StatusCode registerObject(std::string_view parentPath, std::string_view objectPath, DataObject *pObject) override

◆ registerObject() [2/2]

StatusCode EvtStoreSvc::registerObject ( DataObject parentObj,
std::string_view  objectPath,
DataObject pObject 
)
override

Definition at line 619 of file EvtStoreSvc.cpp.

619  {
620  if ( parentObj ) return StatusCode::FAILURE;
621  return fwd( [&, object = std::unique_ptr<DataObject>( pObject ),
622  path = normalize_path( path, rootName() )]( Partition& p ) mutable {
623  if ( m_forceLeaves ) {
624  auto dir = path;
625  for ( auto i = dir.rfind( '/' ); i != std::string_view::npos; i = dir.rfind( '/' ) ) {
626  dir = dir.substr( 0, i );
627  if ( !p.store->find( dir ) ) {
628  if ( msgLevel( MSG::DEBUG ) ) {
629  debug() << "registerObject: adding directory " << std::quoted( dir ) << endmsg;
630  }
631  p.store->put( dir, std::unique_ptr<DataObject>{} );
632  }
633  }
634  }
635  if ( msgLevel( MSG::DEBUG ) ) {
636  auto ptr = object.get();
637  debug() << "registerObject: " << std::quoted( path ) << " (DataObject*)" << static_cast<void*>( ptr )
638  << ( ptr ? " -> " + System::typeinfoName( typeid( *ptr ) ) : std::string{} ) << endmsg;
639  }
640  p.store->put( path, std::move( object ) );
641  return StatusCode::SUCCESS;
642  } );
643 }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
STL namespace.
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Gaudi::Property< bool > m_forceLeaves
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
T move(T... args)
STL class.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
const std::string & rootName() const override

◆ removePreLoadItem()

StatusCode EvtStoreSvc::removePreLoadItem ( const DataStoreItem item)
override

Definition at line 670 of file EvtStoreSvc.cpp.

670  {
671  auto i = std::remove( m_preLoads.begin(), m_preLoads.begin(), item );
672  m_preLoads.erase( i, m_preLoads.end() );
673  return StatusCode::SUCCESS;
674 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
T end(T... args)
T remove(T... args)
T erase(T... args)
T begin(T... args)

◆ resetPreLoad()

StatusCode EvtStoreSvc::resetPreLoad ( )
inlineoverride

Definition at line 372 of file EvtStoreSvc.cpp.

372  {
373  m_preLoads.clear();
374  return StatusCode::SUCCESS;
375  }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
T clear(T... args)

◆ retrieveObject()

StatusCode EvtStoreSvc::retrieveObject ( IRegistry pDirectory,
std::string_view  path,
DataObject *&  pObject 
)
override

Definition at line 644 of file EvtStoreSvc.cpp.

644  {
645  if ( pDirectory ) return StatusCode::FAILURE;
646  return fwd( [&]( Partition& p ) {
647  path = normalize_path( path, rootName() );
648  pObject = const_cast<DataObject*>( p.store->get( path ) );
649  if ( msgLevel( MSG::DEBUG ) ) {
650  debug() << "retrieveObject: " << std::quoted( path ) << " (DataObject*)" << (void*)pObject
651  << ( pObject ? " -> " + System::typeinfoName( typeid( *pObject ) ) : std::string{} ) << endmsg;
652  }
653  return pObject ? StatusCode::SUCCESS : StatusCode::FAILURE;
654  } );
655 }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
STL class.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
const std::string & rootName() const override

◆ rootCLID()

CLID EvtStoreSvc::rootCLID ( ) const
override

Definition at line 422 of file EvtStoreSvc.cpp.

422 { return m_rootCLID; }
Gaudi::Property< CLID > m_rootCLID

◆ rootName()

const std::string & EvtStoreSvc::rootName ( ) const
override

Definition at line 423 of file EvtStoreSvc.cpp.

423 { return m_rootName; }
Gaudi::Property< std::string > m_rootName

◆ selectStore()

StatusCode EvtStoreSvc::selectStore ( size_t  partition)
override

Activate a partition object. The identifies the partition uniquely.

Definition at line 463 of file EvtStoreSvc.cpp.

463  {
464  s_current = &m_partitions[partition];
465  return StatusCode::SUCCESS;
466 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
T partition(T... args)
std::vector< Synced< Partition > > m_partitions
The actual store(s)

◆ setDataLoader()

StatusCode EvtStoreSvc::setDataLoader ( IConversionSvc svc,
IDataProviderSvc dpsvc 
)
override

Definition at line 424 of file EvtStoreSvc.cpp.

424  {
425  m_dataLoader = pDataLoader;
426  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this ).ignore();
427  return StatusCode::SUCCESS;
428 }
SmartIF< IConversionSvc > m_dataLoader
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168

◆ setNumberOfStores()

StatusCode EvtStoreSvc::setNumberOfStores ( size_t  slots)
override

Set the number of event slots (copies of DataSvc objects).

Definition at line 443 of file EvtStoreSvc.cpp.

443  {
444  if ( slots < size_t{1} ) {
445  error() << "Invalid number of slots (" << slots << ")" << endmsg;
446  return StatusCode::FAILURE;
447  }
449  error() << "Too late to change the number of slots!" << endmsg;
450  return StatusCode::FAILURE;
451  }
452  m_slots = slots;
454  return StatusCode::SUCCESS;
455 }
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:62
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< size_t > m_slots
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
static GAUDI_API void setNumConcEvents(const std::size_t &nE)

◆ setRoot() [1/2]

StatusCode EvtStoreSvc::setRoot ( std::string  root_name,
DataObject pObject 
)
override

Definition at line 520 of file EvtStoreSvc.cpp.

520  {
521  if ( msgLevel( MSG::DEBUG ) ) {
522  debug() << "setRoot( " << root_path << ", (DataObject*)" << (void*)pObject << " )" << endmsg;
523  }
524  if ( UNLIKELY( !fwd( []( Partition& p ) {
525  return p.store->empty() ? StatusCode::SUCCESS : StatusCode::FAILURE;
526  } ).isSuccess() ) ) {
527  throw GaudiException{"setRoot called with non-empty store", "EvtStoreSvc", StatusCode::FAILURE};
528  }
529  return registerObject( nullptr, root_path, pObject );
530 }
#define UNLIKELY(x)
Definition: Kernel.h:106
Define general base for Gaudi exception.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
StatusCode registerObject(std::string_view parentPath, std::string_view objectPath, DataObject *pObject) override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ setRoot() [2/2]

StatusCode EvtStoreSvc::setRoot ( std::string  root_path,
IOpaqueAddress pRootAddr 
)
override

Definition at line 531 of file EvtStoreSvc.cpp.

531  {
532  auto rootAddr = std::unique_ptr<IOpaqueAddress>( pRootAddr );
533  if ( msgLevel( MSG::DEBUG ) ) {
534  debug() << "setRoot( " << root_path << ", (IOpaqueAddress*)" << rootAddr.get();
535  if ( rootAddr ) debug() << "[ " << rootAddr->par()[0] << ", " << rootAddr->par()[1] << " ]";
536  debug() << " )" << endmsg;
537  }
538  if ( UNLIKELY( !fwd( []( Partition& p ) {
539  return p.store->empty() ? StatusCode::SUCCESS : StatusCode::FAILURE;
540  } ).isSuccess() ) ) {
541  throw GaudiException{"setRoot called with non-empty store", "EvtStoreSvc", StatusCode::FAILURE};
542  }
543  if ( !rootAddr ) return Status::INVALID_OBJ_ADDR; // Precondition: Address must be valid
544  if ( !m_followLinksToAncestors ) m_onlyThisID = rootAddr->par()[0];
545  auto object = createObj( *m_dataLoader, *rootAddr ); // Call data loader
546  if ( !object ) return Status::INVALID_OBJECT;
547  if ( msgLevel( MSG::DEBUG ) ) { debug() << "Root Object " << root_path << " created " << endmsg; }
548  LocalArena dummy_arena{root_path.size() + 1};
549  auto dummy = Entry{root_path, {}, {}, &dummy_arena};
550  object->setRegistry( &dummy );
551  rootAddr->setRegistry( &dummy );
552  auto status = m_dataLoader->fillObjRefs( rootAddr.get(), object.get() );
553  if ( status.isSuccess() ) {
554  auto pObject = object.get();
555  status = registerObject( nullptr, root_path, object.release() );
556  if ( status.isSuccess() ) pObject->registry()->setAddress( rootAddr.release() );
557  }
558  return status;
559 }
#define UNLIKELY(x)
Definition: Kernel.h:106
Define general base for Gaudi exception.
Gaudi::Property< bool > m_followLinksToAncestors
SmartIF< IConversionSvc > m_dataLoader
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
T size(T... args)
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
STL class.
std::string_view m_onlyThisID
constexpr static const auto FAILURE
Definition: StatusCode.h:101
StatusCode registerObject(std::string_view parentPath, std::string_view objectPath, DataObject *pObject) override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

◆ traverseSubTree() [1/2]

StatusCode EvtStoreSvc::traverseSubTree ( std::string_view  top,
IDataStoreAgent pAgent 
)
override

Definition at line 499 of file EvtStoreSvc.cpp.

499  {
500  return fwd( [&]( Partition& p ) {
501  top = normalize_path( top, rootName() );
502  auto cmp = []( const Entry* lhs, const Entry* rhs ) { return lhs->identifier() < rhs->identifier(); };
503  std::set<const Entry*, decltype( cmp )> keys{std::move( cmp )};
504  for ( const auto& v : *p.store ) {
505  if ( boost::algorithm::starts_with( v.second.identifier(), top ) ) keys.insert( &v.second );
506  }
507  auto k = keys.begin();
508  while ( k != keys.end() ) {
509  const auto& id = ( *k )->identifier();
510  int level = std::count( id.begin(), id.end(), '/' );
511  bool accept = pAgent->analyse( const_cast<Entry*>( *( k++ ) ), level );
512  if ( !accept ) {
513  k = std::find_if_not( k, keys.end(),
514  [&id]( const auto& e ) { return boost::algorithm::starts_with( e->identifier(), id ); } );
515  }
516  }
517  return StatusCode::SUCCESS;
518  } );
519 }
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
def end
Definition: IOTest.py:123
T move(T... args)
T count(T... args)
T find_if_not(T... args)
STL class.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
const std::string & rootName() const override

◆ traverseSubTree() [2/2]

StatusCode EvtStoreSvc::traverseSubTree ( DataObject obj,
IDataStoreAgent pAgent 
)
inlineoverride

Definition at line 336 of file EvtStoreSvc.cpp.

336  {
337  return ( obj && obj->registry() ) ? traverseSubTree( obj->registry()->identifier(), pAgent ) : StatusCode::FAILURE;
338  }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:82
StatusCode traverseSubTree(std::string_view, IDataStoreAgent *) override
constexpr static const auto FAILURE
Definition: StatusCode.h:101
virtual const id_type & identifier() const =0
Full identifier (or key)

◆ traverseTree()

StatusCode EvtStoreSvc::traverseTree ( IDataStoreAgent pAgent)
inlineoverride

Definition at line 339 of file EvtStoreSvc.cpp.

339 { return traverseSubTree( std::string_view{}, pAgent ); }
StatusCode traverseSubTree(std::string_view, IDataStoreAgent *) override

◆ unlinkObject() [1/3]

StatusCode EvtStoreSvc::unlinkObject ( IRegistry ,
std::string_view   
)
inlineoverride

Definition at line 380 of file EvtStoreSvc.cpp.

380 { return dummy( __FUNCTION__ ); }

◆ unlinkObject() [2/3]

StatusCode EvtStoreSvc::unlinkObject ( DataObject ,
std::string_view   
)
inlineoverride

Definition at line 381 of file EvtStoreSvc.cpp.

381 { return dummy( __FUNCTION__ ); }

◆ unlinkObject() [3/3]

StatusCode EvtStoreSvc::unlinkObject ( std::string_view  )
inlineoverride

Definition at line 382 of file EvtStoreSvc.cpp.

382 { return dummy( __FUNCTION__ ); }

◆ unregisterAddress() [1/2]

StatusCode EvtStoreSvc::unregisterAddress ( std::string_view  )
inlineoverride

Definition at line 344 of file EvtStoreSvc.cpp.

344 { return dummy( __FUNCTION__ ); };

◆ unregisterAddress() [2/2]

StatusCode EvtStoreSvc::unregisterAddress ( IRegistry ,
std::string_view   
)
inlineoverride

Definition at line 345 of file EvtStoreSvc.cpp.

345 { return dummy( __FUNCTION__ ); };

◆ unregisterObject() [1/3]

StatusCode EvtStoreSvc::unregisterObject ( std::string_view  sr)
override

Definition at line 662 of file EvtStoreSvc.cpp.

662  {
663  return fwd( [&]( Partition& p ) { return p.store->erase( sr ) != 0 ? StatusCode::SUCCESS : StatusCode::FAILURE; } );
664 }
constexpr double sr
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ unregisterObject() [2/3]

StatusCode EvtStoreSvc::unregisterObject ( DataObject obj)
inlineoverride

Definition at line 353 of file EvtStoreSvc.cpp.

353  {
354  return ( obj && obj->registry() ) ? unregisterObject( obj->registry()->identifier() ) : StatusCode::FAILURE;
355  }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:82
StatusCode unregisterObject(std::string_view) override
constexpr static const auto FAILURE
Definition: StatusCode.h:101
virtual const id_type & identifier() const =0
Full identifier (or key)

◆ unregisterObject() [3/3]

StatusCode EvtStoreSvc::unregisterObject ( DataObject obj,
std::string_view  sr 
)
inlineoverride

Definition at line 356 of file EvtStoreSvc.cpp.

356  {
357  return !obj ? unregisterObject( sr )
358  : obj->registry() ? unregisterObject( ( obj->registry()->identifier() + '/' ).append( sr ) )
359  : StatusCode::FAILURE;
360  };
constexpr double sr
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode unregisterObject(std::string_view) override

◆ updateObject() [1/2]

StatusCode EvtStoreSvc::updateObject ( IRegistry )
inlineoverride

Definition at line 367 of file EvtStoreSvc.cpp.

367 { return dummy( __FUNCTION__ ); }

◆ updateObject() [2/2]

StatusCode EvtStoreSvc::updateObject ( DataObject )
inlineoverride

Definition at line 368 of file EvtStoreSvc.cpp.

368 { return dummy( __FUNCTION__ ); }

Member Data Documentation

◆ m_dataLoader

SmartIF<IConversionSvc> EvtStoreSvc::m_dataLoader
private

Definition at line 284 of file EvtStoreSvc.cpp.

◆ m_estStoreBuckets

Gaudi::Property<std::size_t> EvtStoreSvc::m_estStoreBuckets {this, "StoreBuckets", 100, "Estimated number of buckets in the store"}
private

Definition at line 256 of file EvtStoreSvc.cpp.

◆ m_followLinksToAncestors

Gaudi::Property<bool> EvtStoreSvc::m_followLinksToAncestors
private
Initial value:
{
this, "FollowLinksToAncestors", true,
"Load objects which reside in files other than the one corresponding to the root of the event store"}

Definition at line 299 of file EvtStoreSvc.cpp.

◆ m_forceLeaves

Gaudi::Property<bool> EvtStoreSvc::m_forceLeaves {this, "ForceLeaves", false, "force creation of default leaves on registerObject"}
private

Definition at line 251 of file EvtStoreSvc.cpp.

◆ m_freeSlots

tbb::concurrent_queue<size_t> EvtStoreSvc::m_freeSlots
private

Definition at line 292 of file EvtStoreSvc.cpp.

◆ m_inhibitPrefixes

Gaudi::Property<std::vector<std::string> > EvtStoreSvc::m_inhibitPrefixes
private
Initial value:
{
this,
"InhibitedPathPrefixes",
{},
"Prefixes of TES locations that will not be loaded by the persistency service "}

Definition at line 294 of file EvtStoreSvc.cpp.

◆ m_loader

Gaudi::Property<std::string> EvtStoreSvc::m_loader {this, "DataLoader", "EventPersistencySvc"}
private

Definition at line 252 of file EvtStoreSvc.cpp.

◆ m_onlyThisID

std::string_view EvtStoreSvc::m_onlyThisID
private

Definition at line 302 of file EvtStoreSvc.cpp.

◆ m_partitions

std::vector<Synced<Partition> > EvtStoreSvc::m_partitions
private

The actual store(s)

Definition at line 290 of file EvtStoreSvc.cpp.

◆ m_poolSize

Gaudi::Property<std::size_t> EvtStoreSvc::m_poolSize {this, "PoolSize", 1024, "Initial per-event memory pool size [KiB]"}
private

Definition at line 255 of file EvtStoreSvc.cpp.

◆ m_preLoads

std::vector<DataStoreItem> EvtStoreSvc::m_preLoads
private

Items to be pre-loaded.

Definition at line 287 of file EvtStoreSvc.cpp.

◆ m_printPoolStats

Gaudi::Property<bool> EvtStoreSvc::m_printPoolStats {this, "PrintPoolStats", false, "Print memory pool statistics"}
private

Definition at line 254 of file EvtStoreSvc.cpp.

◆ m_rootCLID

Gaudi::Property<CLID> EvtStoreSvc::m_rootCLID {this, "RootCLID", 110 , "CLID of root entry"}
private

Definition at line 249 of file EvtStoreSvc.cpp.

◆ m_rootName

Gaudi::Property<std::string> EvtStoreSvc::m_rootName {this, "RootName", "/Event", "name of root entry"}
private

Definition at line 250 of file EvtStoreSvc.cpp.

◆ m_servedPoolAllocations

Gaudi::Accumulators::AveragingCounter<std::size_t> EvtStoreSvc::m_servedPoolAllocations
mutableprivate

Definition at line 257 of file EvtStoreSvc.cpp.

◆ m_slots

Gaudi::Property<size_t> EvtStoreSvc::m_slots {this, "EventSlots", 1, "number of event slots"}
private

Definition at line 253 of file EvtStoreSvc.cpp.

◆ m_storeBuckets

Gaudi::Accumulators::AveragingCounter<std::size_t> EvtStoreSvc::m_storeBuckets
mutableprivate

Definition at line 257 of file EvtStoreSvc.cpp.

◆ m_storeEntries

Gaudi::Accumulators::AveragingCounter<std::size_t> EvtStoreSvc::m_storeEntries
mutableprivate

Definition at line 257 of file EvtStoreSvc.cpp.

◆ m_usedPoolAllocations

Gaudi::Accumulators::AveragingCounter<std::size_t> EvtStoreSvc::m_usedPoolAllocations
mutableprivate

Definition at line 257 of file EvtStoreSvc.cpp.

◆ m_usedPoolSize

Gaudi::Accumulators::AveragingCounter<std::size_t> EvtStoreSvc::m_usedPoolSize
mutableprivate

Definition at line 257 of file EvtStoreSvc.cpp.


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