Explicit call to process IOV meta data from the input meta data store, transferring it to the main meta data store.
Normally, this method is called at the BeginInputFile incident. However, this explicit call allows the transfer to occur during the initialization phase, which occurs before BeginInputFile incident.
551{
552
553 std::scoped_lock guard(
m_mutex );
554
555 ATH_MSG_DEBUG(
"processInputFileMetaData: file name " << fileName);
556
557
558 SG::ConstIterator<IOVMetaDataContainer> cont;
559 SG::ConstIterator<IOVMetaDataContainer> contEnd;
560
562 if (!
sc.isSuccess()) {
563 ATH_MSG_DEBUG(
"processInputFileMetaData: Could not retrieve IOVMetaDataContainer objects from InputMetaDataStore - cannot process input file meta data");
564 return StatusCode::SUCCESS;
565 }
566
567 ATH_MSG_DEBUG(
"processInputFileMetaData: Retrieved from IOVMetaDataContainer(s) from InputMetaDataStore");
568
569
570 unsigned int ncolls = 0;
571 unsigned int ndupColls = 0;
572 for (; cont != contEnd; ++cont) {
574 , cont->folderDescription());
575
576
577
578 std::list<SG::ObjectWithVersion<IOVMetaDataContainer> > allVersions;
580 if (!
sc.isSuccess()) {
583 }
584
585 for (SG::ObjectWithVersion<IOVMetaDataContainer>& obj : allVersions) {
587
588 ATH_MSG_DEBUG(
"processInputFileMetaData: New container: payload size " <<
payload->size() <<
" version key " <<
obj.versionedKey);
589
590
591 if (msgLvl(MSG::VERBOSE)) {
593 ATH_MSG_VERBOSE(
"Before merge, payload minRange for folder " << cont->folderName());
594 if (payloadMaster && payloadMaster->
size()) {
595
598 unsigned int iPayload = 0;
599 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
601 << (*itColl)->size());
602 }
603 }
604 else {
606 }
607 }
608 }
609
610
611 if (msgLvl(MSG::DEBUG)) {
615 std::ostringstream
stream;
616 for (; itColl1 != itCollEnd1; ++itColl1) (*itColl1)->dump(stream);
618 }
619
620
621
622
623 for (SG::ObjectWithVersion<IOVMetaDataContainer>& obj : allVersions) {
627 for (; itColl != itCollEnd; ++itColl) {
628
629
630
631 CondAttrListCollection* coll = new CondAttrListCollection(**itColl);
632
635 }
636
637
639 ATH_MSG_ERROR(
"processInputFileMetaData: Could not modify the payload for folder " << contMaster->
folderName());
640 return StatusCode::FAILURE;
641 }
642
644 if (!contMaster->
merge(coll)) {
645
646 delete coll;
647 ++ndupColls;
649 }
650 else {
651 ++ncolls;
653 }
654
655 }
656 ATH_MSG_DEBUG(
"processInputFileMetaData: Merged together containers for folder " << cont->folderName() <<
" ncoll/ndup "
657 << ncolls << " " << ndupColls);
658
659
661 if (payloadMaster && payloadMaster->
size()) {
662
665 IOVTime lastStop;
666 if ((*itColl)->minRange().start().isTimestamp()) lastStop = IOVTime(0);
667 else lastStop = IOVTime(0,0);
668 bool hasError = false;
669 for (; itColl != itCollEnd; ++itColl) {
670 if ((*itColl)->minRange().start() < lastStop) hasError = true;
671 lastStop = (*itColl)->minRange().stop();
672 }
673 if (hasError) {
674 ATH_MSG_ERROR(
"processInputFileMetaData: error after merge of file meta data. " );
675 ATH_MSG_ERROR(
"processInputFileMetaData: Filename " << fileName);
677 ATH_MSG_ERROR(
"processInputFileMetaData: MinRange for meta data folders ");
678 unsigned int iPayload = 0;
679 itColl = payloadMaster->
begin();
680 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
681 ATH_MSG_ERROR(iPayload <<
" " << (*itColl)->minRange() <<
" " << (*itColl)->size());
682 }
683 }
684 }
685
686
687 if (msgLvl(MSG::VERBOSE)) {
689 ATH_MSG_VERBOSE(
"processInputFileMetaData: After merge, payload minRange ");
690 if (payloadMaster) {
691
694 unsigned int iPayload = 0;
695 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
697 << (*itColl)->size());
698 }
699 }
701 }
702
703
704 if (msgLvl(MSG::DEBUG)) {
705 ATH_MSG_DEBUG(
"processInputFileMetaData: Input payload " << cont->folderName());
706 std::ostringstream streamInp;
709 for (; itColl != itCollEnd; ++itColl) (*itColl)->dump(streamInp);
712 std::ostringstream streamOut;
715 for (; itColl != itCollEnd; ++itColl) (*itColl)->dump(streamOut);
717 }
718 }
719 }
720
721 ATH_MSG_DEBUG(
"processInputFileMetaData: Total number of attribute collections merged together " << ncolls
722 << " Number of duplicate collections " << ndupColls);
723
724
725
726
727
728
730
731 return StatusCode::SUCCESS;
732}
#define ATH_MSG_VERBOSE(x)
size_type size() const
size of payload vector
payloadVec::const_iterator const_iterator
const_iterator begin() const
Begin of payload vector.
const_iterator end() const
End of payload vector.
const std::string & key() const
Get the key string with which the current object was stored.