|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef ATHENASERVICES_DELAYEDCONDITIONSCLEANERTOOLSVC_H
14 #define ATHENASERVICES_DELAYEDCONDITIONSCLEANERTOOLSVC_H
24 #include <unordered_map>
30 class DelayedConditionsCleanerTask;
31 class DelayedConditionsCleanerSvcProps;
58 :
public extends<AthService, IConditionsCleanerSvc>
96 virtual StatusCode event (
const EventContext& ctx,
bool allowAsync)
override;
214 typedef std::unordered_map<CondContBase*, CondContInfo>
CCInfoMap_t;
256 std::unique_ptr<DelayedConditionsCleanerSvcProps>
m_props;
263 #endif // not ATHENASERVICES_DELAYEDCONDITIONSCLEANERTOOLSVC_H
void cleanContainers(std::vector< CondContInfo * > &&cis, twoKeys_t &&twoKeys)
Clean a set of containers.
bool operator<(const QueueItem &other) const
std::vector< key_type > m_slotLBN
IOV keys currently in use for each slot.
Interface for doing garbage collection of conditions objects.
Clean conditions containers after a delay.
virtual StatusCode initialize() override
Standard Gaudi initialize method.
~DelayedConditionsCleanerSvc()
Standard destructor.
size_t m_removed2plus
Number of times two or more objects were removed.
EventContext::ContextEvt_t m_evt
std::array< std::vector< key_type >, 2 > twoKeys_t
KeyType
Type of key used for this container.
twoKeys_t getKeys(const Ring &runLBRing, const Ring &TSRing) const
virtual StatusCode condObjAdded(const EventContext &ctx, CondContBase &cc) override
Called after a conditions object has been added.
std::vector< key_type > m_slotTimestamp
std::mutex mutex_t
Serialize access to m_ccinfo and m_work.
friend class DelayedConditionsCleanerTask
Information that we maintain about each conditions container.
size_t m_removed0
Number of times exactly 0 objects were removed.
CondContInfo(CondContBase &cc)
size_t m_removed1
Number of times exactly 1 object was removed.
Some weak symbol referencing magic...
::StatusCode StatusCode
StatusCode definition for legacy code.
Base class for all conditions containers.
size_t m_nEvents
Priority queue statistics.
void scheduleClean(std::vector< CondContInfo * > &&cis, twoKeys_t &&twoKeys, bool allowAsync)
Do cleaning for a set of containers.
AthROOTErrorHandlerSvc * svc
std::priority_queue< QueueItem > m_work
Priority queue of pending cleaning requests.
virtual StatusCode printStats() const override
Print some statistics about the garbage collection.
DelayedConditionsCleanerSvc(const std::string &name, ISvcLocator *svc)
Standard Gaudi constructor.
size_t m_nClean
Number of times cleaning was attempted.
std::lock_guard< mutex_t > lock_t
std::unique_ptr< DelayedConditionsCleanerSvcProps > m_props
Component properties.
std::unordered_map< CondContBase *, CondContInfo > CCInfoMap_t
Map of information, indexed by the conditions container.
virtual StatusCode event(const EventContext &ctx, bool allowAsync) override
Called at the start of each event.
std::atomic< int > m_cleanTasks
Number of active asynchronous cleaning tasks.
bool cleanContainer(CondContInfo *ci, const twoKeys_t &keys) const
Clean a single container.
virtual StatusCode finalize() override
Standard Gaudi finalize method.
CxxUtils::Ring< key_type > Ring
Ring buffer holding most recent IOV keys of a given type.
Ring m_runlbn
Two ring buffers for recent IOV keys, one for run+LBN and one for timestamp.
CondContBase::key_type key_type
Packed key type.
uint64_t key_type
Type used to store an IOV time internally.
QueueItem(EventContext::ContextEvt_t evt, CondContInfo &ci)
virtual StatusCode reset() override
Clear the internal state of the service.
CondContBase & m_cc
The conditions container.
size_t m_nRemoved
Total number of objects removed by cleaning.