 |
ATLAS Offline Software
|
This class provides the interface between Athena and PoolSvc.
More...
#include <AthenaPoolCnvSvc.h>
|
virtual StatusCode | initialize () override |
| Required of all Gaudi Services. More...
|
|
virtual StatusCode | io_reinit () override |
|
virtual StatusCode | finalize () override |
| Required of all Gaudi Services. More...
|
|
virtual StatusCode | io_finalize () override |
|
virtual StatusCode | stop () override |
|
virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override |
| Implementation of IConversionSvc: Create the transient representation of an object from persistent state. More...
|
|
virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override |
| Implementation of IConversionSvc: Convert the transient object to the requested representation. More...
|
|
virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override |
| Implementation of IConversionSvc: Resolve the references of the converted object. More...
|
|
virtual StatusCode | connectOutput (const std::string &outputConnectionSpec, const std::string &openMode) override |
| Implementation of IConversionSvc: Connect to the output connection specification with open mode. More...
|
|
virtual StatusCode | connectOutput (const std::string &outputConnectionSpec) override |
| Implementation of IConversionSvc: Connect to the output connection specification with open mode. More...
|
|
virtual StatusCode | commitOutput (const std::string &outputConnectionSpec, bool doCommit) override |
| Implementation of IConversionSvc: Commit pending output. More...
|
|
virtual StatusCode | disconnectOutput (const std::string &outputConnectionSpec) override |
| Disconnect to the output connection. More...
|
|
virtual IPoolSvc * | getPoolSvc () override |
|
virtual Token * | registerForWrite (Placement *placement, const void *obj, const RootType &classDesc) override |
|
virtual void | setObjPtr (void *&obj, const Token *token) override |
|
virtual bool | useDetailChronoStat () const override |
|
StatusCode | createAddress (long svcType, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override |
| Create a Generic address using explicit arguments to identify a single object. More...
|
|
virtual StatusCode | createAddress (long svcType, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override |
| Create address from string form. More...
|
|
virtual StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override |
| Convert address to string form. More...
|
|
virtual StatusCode | decodeOutputSpec (std::string &connectionSpec, int &outputTech) const override |
| Extract/deduce the DB technology from the connection string/file specification. More...
|
|
virtual StatusCode | registerCleanUp (IAthenaPoolCleanUp *cnv) override |
| Implement registerCleanUp to register a IAthenaPoolCleanUp to be called during cleanUp. More...
|
|
virtual StatusCode | cleanUp (const std::string &connection) override |
| Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function. More...
|
|
virtual StatusCode | setInputAttributes (const std::string &fileName) override |
| Set the input file attributes, if any are requested from jobOpts. More...
|
|
virtual void | handle (const Incident &incident) override |
| Implementation of IIncidentListener: Handle for EndEvent incidence. More...
|
|
void | flushDataHeaderForms (const std::string &streamName="*") |
| Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all) More...
|
|
| AthenaPoolCnvSvc (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard Service Constructor. More...
|
|
virtual | ~AthenaPoolCnvSvc ()=default |
| Destructor. More...
|
|
|
PMonUtils::BasicStopWatchResultMap_t | m_chronoMap {} |
| Map that holds chrono information. More...
|
|
BooleanProperty | m_persSvcPerOutput {this,"PersSvcPerOutput",true} |
| PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream. More...
|
|
StringProperty | m_persSvcPerInputType {this,"PersSvcPerInputType",""} |
| PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type. More...
|
|
std::mutex | m_mutex |
|
IntegerProperty | m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1} |
| To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush. More...
|
|
BooleanProperty | m_oneDataHeaderForm { this, "OneDataHeaderForm", false } |
| If true, use only one DataHeaderForm per Stream. More...
|
|
IntegerProperty | m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 } |
| Property for DataHeaderCnv input DHForm cache size. More...
|
|
BooleanProperty | m_DHFilterAliases { this, "doFilterDHAliases", true } |
| Flag to control SG alias filtering when writing out DataHeader (see DataHeaderCnv_p6) More...
|
|
|
void | extractPoolAttributes (const StringArrayProperty &property, std::vector< std::vector< std::string > > *contAttr, std::vector< std::vector< std::string > > *dbAttr, std::vector< std::vector< std::string > > *domAttr=0) const |
| Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property. More...
|
|
StatusCode | processPoolAttributes (std::vector< std::vector< std::string > > &attr, const std::string &fileName, unsigned long contextId, bool doGet=true, bool doSet=true, bool doClear=true) const |
| Set/get technology dependent POOL attributes. More...
|
|
|
pool::DbType | m_dbType |
| decoded storage tech requested in "StorageTechnology" property More...
|
|
std::string | m_lastInputFileName |
|
ServiceHandle< IPoolSvc > | m_poolSvc {this,"PoolSvc","PoolSvc"} |
|
ServiceHandle< IClassIDSvc > | m_clidSvc {this,"ClassIDSvc","ClassIDSvc"} |
|
BooleanProperty | m_useDetailChronoStat {this,"UseDetailChronoStat",false} |
| UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false. More...
|
|
StringProperty | m_storageTechProp {this,"StorageTechnology", "ROOTTREEINDEX"} |
| Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE) More...
|
|
StringProperty | m_containerPrefixProp {this,"PoolContainerPrefix","Default"} |
| POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix from APRDefaults according to StorageTech. More...
|
|
StringProperty | m_containerNameHintProp {this,"TopLevelContainerName",""} |
| TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>". More...
|
|
StringProperty | m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"} |
| SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching) More...
|
|
StringArrayProperty | m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"} |
| Output PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
|
|
std::vector< std::vector< std::string > > | m_domainAttr |
|
std::vector< std::vector< std::string > > | m_databaseAttr |
|
std::vector< std::vector< std::string > > | m_containerAttr |
|
std::vector< unsigned int > | m_contextAttr |
|
std::map< std::string, int > | m_fileCommitCounter |
|
std::map< std::string, int > | m_fileFlushSetting |
|
StringArrayProperty | m_inputPoolAttr {this,"InputPoolAttributes",{}} |
| Input PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
|
|
std::vector< std::vector< std::string > > | m_inputAttr |
|
StringArrayProperty | m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}} |
| Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event. More...
|
|
std::vector< std::vector< std::string > > | m_inputAttrPerEvent |
|
StringArrayProperty | m_maxFileSizes {this,"MaxFileSizes",{}} |
| MaxFileSizes, vector with maximum file sizes for Athena POOL output files. More...
|
|
long long | m_domainMaxFileSize =std::numeric_limits<long long>::max() |
|
std::map< std::string, long long > | m_databaseMaxFileSize |
|
This class provides the interface between Athena and PoolSvc.
Definition at line 40 of file AthenaPoolCnvSvc.h.
◆ AthenaPoolCnvSvc()
AthenaPoolCnvSvc::AthenaPoolCnvSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Standard Service Constructor.
Definition at line 567 of file AthenaPoolCnvSvc.cxx.
568 base_class(
name, pSvcLocator, POOL_StorageType) {
◆ ~AthenaPoolCnvSvc()
virtual AthenaPoolCnvSvc::~AthenaPoolCnvSvc |
( |
| ) |
|
|
virtualdefault |
◆ cleanUp()
StatusCode AthenaPoolCnvSvc::cleanUp |
( |
const std::string & |
connection | ) |
|
|
overridevirtual |
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
Definition at line 516 of file AthenaPoolCnvSvc.cxx.
517 bool retError =
false;
518 std::size_t cpos = connection.find(
':');
519 std::size_t bpos = connection.find(
'[');
520 if (cpos == std::string::npos) {
525 if (bpos != std::string::npos) bpos = bpos - cpos;
526 const std::string
conn = connection.substr(cpos, bpos);
528 for (
auto converter : m_cnvs) {
529 if (!converter->cleanUp(
conn).isSuccess()) {
534 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
◆ commitOutput()
StatusCode AthenaPoolCnvSvc::commitOutput |
( |
const std::string & |
outputConnectionSpec, |
|
|
bool |
doCommit |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Commit pending output.
- Parameters
-
doCommit | [IN] boolean to force full commit |
Definition at line 329 of file AthenaPoolCnvSvc.cxx.
331 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
338 ATH_MSG_ERROR(
"connectOutput FAILED extract file name and technology.");
339 return(StatusCode::FAILURE);
343 ATH_MSG_DEBUG(
"commitOutput failed process POOL domain attributes.");
346 ATH_MSG_DEBUG(
"commitOutput failed process POOL database attributes.");
349 ATH_MSG_DEBUG(
"commitOutput failed process POOL container attributes.");
351 std::size_t
merge = outputConnection.find(
"?pmerge=");
352 const std::string baseOutputConnection = outputConnection.substr(0,
merge);
362 if (!
m_poolSvc->commit(contextId).isSuccess()) {
363 ATH_MSG_ERROR(
"commitOutput FAILED to commit OutputStream.");
364 return(StatusCode::FAILURE);
367 if (!
m_poolSvc->commitAndHold(contextId).isSuccess()) {
368 ATH_MSG_ERROR(
"commitOutput FAILED to commitAndHold OutputStream.");
369 return(StatusCode::FAILURE);
374 return(StatusCode::FAILURE);
376 if (!this->
cleanUp(baseOutputConnection).isSuccess()) {
378 return(StatusCode::FAILURE);
381 long long int currentFileSize =
m_poolSvc->getFileSize(outputConnection,
m_dbType.
type(), contextId);
385 return(StatusCode::RECOVERABLE);
389 return(StatusCode::RECOVERABLE);
391 return(StatusCode::SUCCESS);
◆ connectOutput() [1/2]
StatusCode AthenaPoolCnvSvc::connectOutput |
( |
const std::string & |
outputConnectionSpec | ) |
|
|
overridevirtual |
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
- Parameters
-
outputConnectionSpec | [IN] the name of the output connection specification as string. |
Definition at line 256 of file AthenaPoolCnvSvc.cxx.
258 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
262 ATH_MSG_ERROR(
"connectOutput FAILED extract file name and technology.");
263 return(StatusCode::FAILURE);
268 ATH_MSG_ERROR(
"connectOutput FAILED to open an UPDATE transaction.");
269 return(StatusCode::FAILURE);
273 return(StatusCode::FAILURE);
278 std::size_t
merge = outputConnection.find(
"?pmerge=");
282 std::vector<std::string> maxFileSize;
283 maxFileSize.push_back(
"TREE_MAX_SIZE");
284 maxFileSize.push_back(
"1099511627776L");
291 const std::string&
opt = (*iter)[0];
292 std::string&
data = (*iter)[1];
293 const std::string&
file = (*iter)[2];
294 const std::string& cont = (*iter)[3];
295 std::size_t
equal = cont.find(
'=');
299 if (colon == std::string::npos) colon = 0;
302 if (
merge != std::string::npos &&
opt ==
"TREE_AUTO_FLUSH" && 0 == outputConnection.compare(0,
merge,
file) &&cont.compare(
equal, std::string::npos, strProp, colon) == 0 &&
data !=
"int" &&
data !=
"DbLonglong" &&
data !=
"double" &&
data !=
"string") {
306 std::ostringstream eventAutoFlush;
307 eventAutoFlush <<
flush;
308 data = eventAutoFlush.str();
314 if (
merge != std::string::npos) {
315 ATH_MSG_INFO(
"connectOutput setting auto write for: " << outputConnection <<
" to " <<
flush <<
" events");
320 ATH_MSG_DEBUG(
"connectOutput failed process POOL domain attributes.");
323 ATH_MSG_DEBUG(
"connectOutput failed process POOL database attributes.");
325 return(StatusCode::SUCCESS);
◆ connectOutput() [2/2]
StatusCode AthenaPoolCnvSvc::connectOutput |
( |
const std::string & |
outputConnectionSpec, |
|
|
const std::string & |
openMode |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
- Parameters
-
outputConnectionSpec | [IN] the name of the output connection specification as string. |
openMode | [IN] the open mode of the file as string. |
Definition at line 251 of file AthenaPoolCnvSvc.cxx.
◆ convertAddress()
StatusCode AthenaPoolCnvSvc::convertAddress |
( |
const IOpaqueAddress * |
pAddress, |
|
|
std::string & |
refAddress |
|
) |
| |
|
overridevirtual |
Convert address to string form.
- Parameters
-
pAddress | [IN] address to be converted. |
refAddress | [OUT] converted string form. |
Definition at line 478 of file AthenaPoolCnvSvc.cxx.
482 if (tokAddr !=
nullptr && tokAddr->
getToken() !=
nullptr) {
485 refAddress = *pAddress->par();
487 return(StatusCode::SUCCESS);
◆ createAddress() [1/2]
StatusCode AthenaPoolCnvSvc::createAddress |
( |
long |
svcType, |
|
|
const CLID & |
clid, |
|
|
const std::string & |
refAddress, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
overridevirtual |
Create address from string form.
- Parameters
-
svcType | [IN] service type of the address. |
clid | [IN] class id for the address. |
refAddress | [IN] string form to be converted. |
refpAddress | [OUT] converted address. |
Definition at line 466 of file AthenaPoolCnvSvc.cxx.
470 if (svcType != POOL_StorageType) {
471 ATH_MSG_ERROR(
"createAddress: svcType != POOL_StorageType " << svcType <<
" " << POOL_StorageType);
472 return(StatusCode::FAILURE);
474 refpAddress =
new GenericAddress(POOL_StorageType, clid, refAddress);
475 return(StatusCode::SUCCESS);
◆ createAddress() [2/2]
StatusCode AthenaPoolCnvSvc::createAddress |
( |
long |
svcType, |
|
|
const CLID & |
clid, |
|
|
const std::string * |
par, |
|
|
const unsigned long * |
ip, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
override |
Create a Generic address using explicit arguments to identify a single object.
- Parameters
-
svcType | [IN] service type of the address. |
clid | [IN] class id for the address. |
par | [IN] string containing the database name. |
ip | [IN] object identifier. |
refpAddress | [OUT] converted address. |
Definition at line 440 of file AthenaPoolCnvSvc.cxx.
445 if (svcType != POOL_StorageType) {
446 ATH_MSG_ERROR(
"createAddress: svcType != POOL_StorageType " << svcType <<
" " << POOL_StorageType);
447 return(StatusCode::FAILURE);
449 std::unique_ptr<Token> token;
451 token = std::make_unique<Token>();
459 if (token ==
nullptr) {
460 return(StatusCode::RECOVERABLE);
463 return(StatusCode::SUCCESS);
◆ createObj()
StatusCode AthenaPoolCnvSvc::createObj |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject *& |
refpObject |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Create the transient representation of an object from persistent state.
- Parameters
-
pAddress | [IN] pointer to IOpaqueAddress of the representation. |
refpObject | [OUT] pointer to DataObject to be created. |
Definition at line 151 of file AthenaPoolCnvSvc.cxx.
153 std::string objName =
"ALL";
155 if (
m_clidSvc->getTypeNameOfID(pAddress->clID(), objName).isFailure()) {
156 std::ostringstream oss;
157 oss << std::dec << pAddress->clID();
161 objName += *(pAddress->par() + 1);
168 const unsigned int maxContext =
m_poolSvc->getInputContextMap().size();
171 ::sprintf(
text,
"[CTXT=%08X]", auxContext);
172 if (
m_poolSvc->getInputContextMap().size() > maxContext) {
174 ATH_MSG_DEBUG(
"setInputAttribute failed to switch off TTreeCache for id = " << auxContext <<
".");
◆ createRep()
StatusCode AthenaPoolCnvSvc::createRep |
( |
DataObject * |
pObject, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Convert the transient object to the requested representation.
- Parameters
-
pObject | [IN] pointer to DataObject. |
refpAddress | [OUT] pointer to IOpaqueAddress of the representation to be created. |
Definition at line 185 of file AthenaPoolCnvSvc.cxx.
187 std::string objName =
"ALL";
189 if (
m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
190 std::ostringstream oss;
191 oss << std::dec << pObject->clID();
195 objName += pObject->registry()->name();
200 if (pObject->clID() == 1) {
203 if (
proxy !=
nullptr) {
204 IConverter* cnv = converter(
proxy->clID());
205 status = cnv->createRep(pObject, refpAddress);
211 }
catch(std::runtime_error&
e) {
◆ decodeOutputSpec()
StatusCode AthenaPoolCnvSvc::decodeOutputSpec |
( |
std::string & |
connectionSpec, |
|
|
int & |
outputTech |
|
) |
| const |
|
overridevirtual |
Extract/deduce the DB technology from the connection string/file specification.
Definition at line 490 of file AthenaPoolCnvSvc.cxx.
491 if (fileSpec.starts_with (
"oracle") || fileSpec.starts_with (
"mysql")) {
492 outputTech = pool::POOL_RDBMS_StorageType.
type();
493 }
else if (fileSpec.starts_with (
"ROOTKEY:")) {
494 outputTech = pool::ROOTKEY_StorageType.
type();
495 fileSpec.erase(0, 8);
496 }
else if (fileSpec.starts_with (
"ROOTTREE:")) {
497 outputTech = pool::ROOTTREE_StorageType.
type();
498 fileSpec.erase(0, 9);
499 }
else if (fileSpec.starts_with (
"ROOTTREEINDEX:")) {
500 outputTech = pool::ROOTTREEINDEX_StorageType.
type();
501 fileSpec.erase(0, 14);
502 }
else if (fileSpec.starts_with (
"ROOTRNTUPLE:")) {
503 outputTech = pool::ROOTRNTUPLE_StorageType.
type();
504 fileSpec.erase(0, 12);
505 }
else if (outputTech == 0) {
508 return(StatusCode::SUCCESS);
◆ disconnectOutput()
StatusCode AthenaPoolCnvSvc::disconnectOutput |
( |
const std::string & |
outputConnectionSpec | ) |
|
|
overridevirtual |
Disconnect to the output connection.
Definition at line 395 of file AthenaPoolCnvSvc.cxx.
396 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
◆ extractPoolAttributes()
void AthenaPoolCnvSvc::extractPoolAttributes |
( |
const StringArrayProperty & |
property, |
|
|
std::vector< std::vector< std::string > > * |
contAttr, |
|
|
std::vector< std::vector< std::string > > * |
dbAttr, |
|
|
std::vector< std::vector< std::string > > * |
domAttr = 0 |
|
) |
| const |
|
private |
Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property.
Definition at line 571 of file AthenaPoolCnvSvc.cxx.
575 std::vector<std::string>
opt;
576 std::string attributeName, containerName, databaseName, valueString;
577 for (std::vector<std::string>::const_iterator
iter = property.value().begin(),
578 last = property.value().end();
iter != last; ++
iter) {
580 attributeName.clear();
581 containerName.clear();
582 databaseName.clear();
584 using Gaudi::Utils::AttribStringParser;
585 for (
const AttribStringParser::Attrib& attrib : AttribStringParser (*
iter)) {
586 const std::string
tag = attrib.tag;
587 const std::string
val = attrib.value;
588 if (
tag ==
"DatabaseName") {
590 }
else if (
tag ==
"ContainerName") {
591 if (databaseName.empty()) {
594 containerName = std::move(
val);
596 attributeName = std::move(
tag);
597 valueString = std::move(
val);
600 if (!attributeName.empty() && !valueString.empty()) {
601 opt.push_back(attributeName);
602 opt.push_back(valueString);
603 if (!databaseName.empty()) {
604 opt.push_back(databaseName);
605 if (!containerName.empty()) {
606 opt.push_back(containerName);
607 if (containerName.compare(0, 6,
"TTree=") == 0) {
608 dbAttr->push_back(
opt);
610 contAttr->push_back(
opt);
614 dbAttr->push_back(
opt);
616 }
else if (domAttr != 0) {
617 domAttr->push_back(
opt);
621 dbAttr->push_back(
opt);
◆ fillRepRefs()
StatusCode AthenaPoolCnvSvc::fillRepRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Resolve the references of the converted object.
- Parameters
-
pAddress | [IN] pointer to IOpaqueAddress of the representation to be resolved. |
pObject | [IN] pointer to DataObject to be created. |
Definition at line 218 of file AthenaPoolCnvSvc.cxx.
220 std::string objName =
"ALL";
222 if (
m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
223 std::ostringstream oss;
224 oss << std::dec << pObject->clID();
228 objName += pObject->registry()->name();
233 if (pObject->clID() == 1) {
236 if (
proxy !=
nullptr) {
237 IConverter* cnv = converter(
proxy->clID());
238 status = cnv->fillRepRefs(pAddress, pObject);
244 }
catch(std::runtime_error&
e) {
◆ finalize()
StatusCode AthenaPoolCnvSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Required of all Gaudi Services.
Definition at line 117 of file AthenaPoolCnvSvc.cxx.
131 const std::string msgPrefix{
"PerfStats "};
133 ATH_MSG_INFO(msgPrefix <<
"Timing Measurements for AthenaPoolCnvSvc");
136 ATH_MSG_INFO(msgPrefix <<
"| " << std::left << std::setw(15) <<
key <<
" | "
137 << std::right << std::setw(15) << std::fixed << std::setprecision(0) <<
value <<
" ms |");
142 m_cnvs.shrink_to_fit();
143 return(StatusCode::SUCCESS);
◆ flushDataHeaderForms()
void AthenaPoolCnvSvc::flushDataHeaderForms |
( |
const std::string & |
streamName = "*" | ) |
|
Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
Definition at line 103 of file AthenaPoolCnvSvc.cxx.
106 FileIncident incident(
name(),
"WriteDataHeaderForms",
streamName);
107 if( DHCnvListener ) DHCnvListener->handle(incident);
◆ getPoolSvc()
IPoolSvc * AthenaPoolCnvSvc::getPoolSvc |
( |
| ) |
|
|
overridevirtual |
◆ handle()
void AthenaPoolCnvSvc::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
◆ initialize()
StatusCode AthenaPoolCnvSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Required of all Gaudi Services.
Definition at line 33 of file AthenaPoolCnvSvc.cxx.
44 if (!iomgr->io_register(
this).isSuccess()) {
45 ATH_MSG_FATAL(
"Could not register myself with the IoComponentMgr !");
46 return(StatusCode::FAILURE);
51 if (
auto p =
iter->find(
'=');
p != std::string::npos) {
52 long long maxFileSize = atoll(
iter->data() + (
p + 1));
53 std::string databaseName =
iter->substr(0,
iter->find_first_of(
" ="));
63 return StatusCode::FAILURE;
80 incSvc->addListener(
this,
"EndEvent", pri);
81 ATH_MSG_DEBUG(
"Subscribed to EndEvent for printing out input file attributes.");
84 ATH_MSG_DEBUG(
"setInputAttribute failed setting POOL domain attributes.");
89 TClass::GetClass (
"TLeafI");
90 TClass::GetClass (
"TLeafL");
91 TClass::GetClass (
"TLeafD");
92 TClass::GetClass (
"TLeafF");
94 return(StatusCode::SUCCESS);
◆ io_finalize()
StatusCode AthenaPoolCnvSvc::io_finalize |
( |
| ) |
|
|
overridevirtual |
◆ io_reinit()
StatusCode AthenaPoolCnvSvc::io_reinit |
( |
| ) |
|
|
overridevirtual |
◆ outputContextId()
unsigned int AthenaPoolCnvSvc::outputContextId |
( |
const std::string & |
outputConnection | ) |
|
|
protected |
◆ processPoolAttributes()
StatusCode AthenaPoolCnvSvc::processPoolAttributes |
( |
std::vector< std::vector< std::string > > & |
attr, |
|
|
const std::string & |
fileName, |
|
|
unsigned long |
contextId, |
|
|
bool |
doGet = true , |
|
|
bool |
doSet = true , |
|
|
bool |
doClear = true |
|
) |
| const |
|
private |
Set/get technology dependent POOL attributes.
Definition at line 627 of file AthenaPoolCnvSvc.cxx.
633 bool retError =
false;
634 for (std::vector<std::vector<std::string> >::
iterator iter = attr.begin(), last = attr.end();
636 if (
iter->size() == 2) {
637 const std::string&
opt = (*iter)[0];
638 std::string
data = (*iter)[1];
639 if (
data ==
"int" ||
data ==
"DbLonglong" ||
data ==
"double" ||
data ==
"string") {
658 if (
iter->size() == 4) {
659 const std::string&
opt = (*iter)[0];
660 std::string
data = (*iter)[1];
661 const std::string&
file = (*iter)[2];
662 const std::string& cont = (*iter)[3];
664 || (
file[0] ==
'*' &&
file.find(
"," +
fileName +
",") == std::string::npos))) {
665 if (
data ==
"int" ||
data ==
"DbLonglong" ||
data ==
"double" ||
data ==
"string") {
690 for (std::vector<std::vector<std::string> >::
iterator iter = attr.begin();
iter != attr.end(); ) {
697 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
◆ registerCleanUp()
◆ registerForWrite()
- Returns
- a string token to a Data Object written to Pool
- Parameters
-
placement | [IN] pointer to the placement hint |
obj | [IN] pointer to the Data Object to be written to Pool |
classDesc | [IN] pointer to the Seal class description for the Data Object. |
Definition at line 413 of file AthenaPoolCnvSvc.cxx.
416 Token* token =
nullptr;
422 token =
m_poolSvc->registerForWrite(placement,
obj, classDesc);
◆ setInputAttributes()
StatusCode AthenaPoolCnvSvc::setInputAttributes |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
Set the input file attributes, if any are requested from jobOpts.
- Parameters
-
fileName | [IN] name of the input file |
Definition at line 537 of file AthenaPoolCnvSvc.cxx.
541 ATH_MSG_DEBUG(
"setInputAttribute failed setting POOL database/container attributes.");
544 ATH_MSG_DEBUG(
"setInputAttribute failed getting POOL database/container attributes.");
548 const auto& extraInputContextMap =
m_poolSvc->getInputContextMap();
549 for (
const auto& [
label,
id]: extraInputContextMap) {
551 ATH_MSG_DEBUG(
"setInputAttribute failed to switch off TTreeCache for = " <<
label <<
".");
555 return(StatusCode::SUCCESS);
◆ setObjPtr()
void AthenaPoolCnvSvc::setObjPtr |
( |
void *& |
obj, |
|
|
const Token * |
token |
|
) |
| |
|
overridevirtual |
- Parameters
-
obj | [OUT] pointer to the Data Object. |
token | [IN] string token of the Data Object for which a Pool Ref is filled. |
Definition at line 426 of file AthenaPoolCnvSvc.cxx.
◆ stop()
StatusCode AthenaPoolCnvSvc::stop |
( |
| ) |
|
|
overridevirtual |
◆ useDetailChronoStat()
bool AthenaPoolCnvSvc::useDetailChronoStat |
( |
| ) |
const |
|
overridevirtual |
◆ SvcFactory< AthenaPoolCnvSvc >
◆ m_branchNameHintProp
StringProperty AthenaPoolCnvSvc::m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"} |
|
private |
SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching)
Definition at line 197 of file AthenaPoolCnvSvc.h.
◆ m_chronoMap
◆ m_clidSvc
◆ m_containerAttr
std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_containerAttr |
|
private |
◆ m_containerNameHintProp
StringProperty AthenaPoolCnvSvc::m_containerNameHintProp {this,"TopLevelContainerName",""} |
|
private |
TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>".
Definition at line 195 of file AthenaPoolCnvSvc.h.
◆ m_containerPrefixProp
StringProperty AthenaPoolCnvSvc::m_containerPrefixProp {this,"PoolContainerPrefix","Default"} |
|
private |
◆ m_contextAttr
std::vector<unsigned int> AthenaPoolCnvSvc::m_contextAttr |
|
private |
◆ m_databaseAttr
std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_databaseAttr |
|
private |
◆ m_databaseMaxFileSize
std::map<std::string, long long> AthenaPoolCnvSvc::m_databaseMaxFileSize |
|
private |
◆ m_dbType
decoded storage tech requested in "StorageTechnology" property
Definition at line 175 of file AthenaPoolCnvSvc.h.
◆ m_DHFilterAliases
BooleanProperty AthenaPoolCnvSvc::m_DHFilterAliases { this, "doFilterDHAliases", true } |
|
protected |
◆ m_DHFormCacheSize
IntegerProperty AthenaPoolCnvSvc::m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 } |
|
protected |
◆ m_domainAttr
std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_domainAttr |
|
private |
◆ m_domainMaxFileSize
long long AthenaPoolCnvSvc::m_domainMaxFileSize =std::numeric_limits<long long>::max() |
|
private |
◆ m_fileCommitCounter
std::map<std::string, int> AthenaPoolCnvSvc::m_fileCommitCounter |
|
private |
◆ m_fileFlushSetting
std::map<std::string, int> AthenaPoolCnvSvc::m_fileFlushSetting |
|
private |
◆ m_inputAttr
std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttr |
|
private |
◆ m_inputAttrPerEvent
std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttrPerEvent |
|
private |
◆ m_inputPoolAttr
StringArrayProperty AthenaPoolCnvSvc::m_inputPoolAttr {this,"InputPoolAttributes",{}} |
|
private |
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition at line 208 of file AthenaPoolCnvSvc.h.
◆ m_inputPoolAttrPerEvent
StringArrayProperty AthenaPoolCnvSvc::m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}} |
|
private |
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event.
Definition at line 212 of file AthenaPoolCnvSvc.h.
◆ m_lastInputFileName
std::string AthenaPoolCnvSvc::m_lastInputFileName |
|
private |
◆ m_maxFileSizes
StringArrayProperty AthenaPoolCnvSvc::m_maxFileSizes {this,"MaxFileSizes",{}} |
|
private |
◆ m_mutex
std::mutex AthenaPoolCnvSvc::m_mutex |
|
protected |
◆ m_numberEventsPerWrite
IntegerProperty AthenaPoolCnvSvc::m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1} |
|
protected |
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush.
Definition at line 233 of file AthenaPoolCnvSvc.h.
◆ m_oneDataHeaderForm
BooleanProperty AthenaPoolCnvSvc::m_oneDataHeaderForm { this, "OneDataHeaderForm", false } |
|
protected |
◆ m_persSvcPerInputType
StringProperty AthenaPoolCnvSvc::m_persSvcPerInputType {this,"PersSvcPerInputType",""} |
|
protected |
PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type.
default = "", no tree name results in a single persistency service.
Definition at line 228 of file AthenaPoolCnvSvc.h.
◆ m_persSvcPerOutput
BooleanProperty AthenaPoolCnvSvc::m_persSvcPerOutput {this,"PersSvcPerOutput",true} |
|
protected |
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
default = true.
Definition at line 223 of file AthenaPoolCnvSvc.h.
◆ m_poolAttr
StringArrayProperty AthenaPoolCnvSvc::m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"} |
|
private |
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition at line 200 of file AthenaPoolCnvSvc.h.
◆ m_poolSvc
◆ m_storageTechProp
StringProperty AthenaPoolCnvSvc::m_storageTechProp {this,"StorageTechnology", "ROOTTREEINDEX"} |
|
private |
◆ m_useDetailChronoStat
BooleanProperty AthenaPoolCnvSvc::m_useDetailChronoStat {this,"UseDetailChronoStat",false} |
|
private |
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false.
Definition at line 187 of file AthenaPoolCnvSvc.h.
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
ServiceHandle< IPoolSvc > m_poolSvc
std::vector< unsigned int > m_contextAttr
virtual StatusCode cleanUp(const std::string &connection) override
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
char data[hepevt_bytes_allocation_ATLAS]
static const Guid & null()
NULL-Guid: static class method.
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
static DbType getType(const std::string &name)
Access known storage type object by name.
unsigned outputContextId(const std::string &outputConnection)
std::string find(const std::string &s)
return a remapped string
ServiceHandle< IClassIDSvc > m_clidSvc
const std::string & contID() const
Access container identifier.
BooleanProperty m_useDetailChronoStat
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = fa...
long long m_domainMaxFileSize
std::vector< std::vector< std::string > > m_inputAttrPerEvent
virtual StatusCode decodeOutputSpec(std::string &connectionSpec, int &outputTech) const override
Extract/deduce the DB technology from the connection string/file specification.
const Guid & dbID() const
Access database identifier.
std::vector< std::vector< std::string > > m_databaseAttr
PMonUtils::BasicStopWatchResultMap_t m_chronoMap
Map that holds chrono information.
const std::string toString() const
Automatic conversion to string representation.
pool::DbType m_dbType
decoded storage tech requested in "StorageTechnology" property
const Guid & classID() const
Access database identifier.
#define ATH_MSG_VERBOSE(x)
Placement & setAuxString(const std::string &auxString)
Set auxiliary string.
StatusCode processPoolAttributes(std::vector< std::vector< std::string > > &attr, const std::string &fileName, unsigned long contextId, bool doGet=true, bool doSet=true, bool doClear=true) const
Set/get technology dependent POOL attributes.
void flushDataHeaderForms(const std::string &streamName="*")
Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
std::map< std::string, int > m_fileFlushSetting
int type() const
Access to full type.
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
This class provides a token that identifies in a unique way objects on the persistent storage.
StringProperty m_persSvcPerInputType
PersSvcPerInputType, string property, tree name to use multiple persistency services,...
StringProperty m_storageTechProp
Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)
void extractPoolAttributes(const StringArrayProperty &property, std::vector< std::vector< std::string > > *contAttr, std::vector< std::vector< std::string > > *dbAttr, std::vector< std::vector< std::string > > *domAttr=0) const
Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property.
This class provides a Generic Transient Address for POOL tokens.
static constexpr const char * EventData
Token & setClassID(const Guid &cl_id)
Access database identifier.
StringArrayProperty m_maxFileSizes
MaxFileSizes, vector with maximum file sizes for Athena POOL output files.
::StatusCode StatusCode
StatusCode definition for legacy code.
Default, invalid implementation of ClassID_traits.
std::vector< std::vector< std::string > > m_inputAttr
std::map< std::string, long long > m_databaseMaxFileSize
const std::string & fileName() const
Access file name.
IntegerProperty m_numberEventsPerWrite
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on numb...
std::vector< std::vector< std::string > > m_containerAttr
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
BooleanProperty m_persSvcPerOutput
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
virtual const std::string toString() const
Retrieve the string representation of the token.
StringArrayProperty m_inputPoolAttr
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
Token & setOid(const OID_t &oid)
Set object identifier.
std::vector< std::vector< std::string > > m_domainAttr
std::map< std::string, int > m_fileCommitCounter
bool exactMatch(const DbType &typ) const
#define ATH_MSG_WARNING(x)
Token & setAuxString(const std::string &auxString)
Set auxiliary string.
virtual StatusCode connectOutput(const std::string &outputConnectionSpec, const std::string &openMode) override
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
StringArrayProperty m_poolAttr
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
StringArrayProperty m_inputPoolAttrPerEvent
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to...
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
StringProperty m_containerPrefixProp
POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix f...
static constexpr const char * EventData
std::string m_lastInputFileName
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.