Commit a876a4ea authored by Rachid Mazini's avatar Rachid Mazini
Browse files

Merge branch 'cherry-pick-11eb73dd' into '21.0-mc16a'

AthenaPoolCnvSvc: Re-initialize AthenaPoolCnvSvc and extract the Pool Attributes for the output file - cherry-pick from 21.0

See merge request !39507
parents a9b770be acac6f51
......@@ -11,6 +11,7 @@
#include "GaudiKernel/ClassID.h"
#include "GaudiKernel/IChronoStatSvc.h"
#include "GaudiKernel/IIoComponentMgr.h"
#include "GaudiKernel/IOpaqueAddress.h"
#include "GaudiKernel/IJobOptionsSvc.h"
#include "GaudiKernel/IIncidentSvc.h"
......@@ -82,6 +83,14 @@ StatusCode AthenaPoolCnvSvc::initialize() {
return(StatusCode::FAILURE);
}
}
// Register this service for 'I/O' events
ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
ATH_CHECK(iomgr.retrieve());
if (!iomgr->io_register(this).isSuccess()) {
ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !");
return(StatusCode::FAILURE);
}
// Extracting MaxFileSizes for global default and map by Database name.
for (std::vector<std::string>::const_iterator iter = m_maxFileSizes.value().begin(),
last = m_maxFileSizes.value().end(); iter != last; iter++) {
......@@ -125,6 +134,13 @@ StatusCode AthenaPoolCnvSvc::initialize() {
return(StatusCode::SUCCESS);
}
//______________________________________________________________________________
StatusCode AthenaPoolCnvSvc::io_reinit() {
ATH_MSG_DEBUG("I/O reinitialization...");
// Extracting OUTPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
extractPoolAttributes(m_poolAttr, &m_containerAttr, &m_databaseAttr, &m_domainAttr);
return(StatusCode::SUCCESS);
}
//______________________________________________________________________________
StatusCode AthenaPoolCnvSvc::finalize() {
// Release AthenaSerializeSvc
if (!m_serializeSvc.empty()) {
......@@ -161,6 +177,11 @@ StatusCode AthenaPoolCnvSvc::finalize() {
m_cnvs.shrink_to_fit();
return(::AthCnvSvc::finalize());
}
//______________________________________________________________________________
StatusCode AthenaPoolCnvSvc::io_finalize() {
ATH_MSG_DEBUG("I/O finalization...");
return(StatusCode::SUCCESS);
}
//_______________________________________________________________________
StatusCode AthenaPoolCnvSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) {
if (IAthenaPoolCnvSvc::interfaceID().versionMatch(riid)) {
......
......@@ -13,6 +13,7 @@
#include "AthenaPoolCnvSvc/IAthenaPoolCnvSvc.h"
#include "GaudiKernel/IIncidentListener.h"
#include "GaudiKernel/IIoComponent.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/ToolHandle.h"
#include "StorageSvc/DbType.h"
......@@ -36,15 +37,18 @@ template <class TYPE> class SvcFactory;
**/
class AthenaPoolCnvSvc : public ::AthCnvSvc,
public virtual IAthenaPoolCnvSvc,
public virtual IIncidentListener {
public virtual IIncidentListener,
public virtual IIoComponent {
// Allow the factory class access to the constructor
friend class SvcFactory<AthenaPoolCnvSvc>;
public:
/// Required of all Gaudi Services
StatusCode initialize();
StatusCode io_reinit();
/// Required of all Gaudi Services
StatusCode finalize();
StatusCode io_finalize();
/// Required of all Gaudi services: see Gaudi documentation for details
StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment