148{
150 for(const std::string& tag : globalTags) {
152 std::vector<NodeToRecordsetMap> map;
153 map.resize(2);
154 size_t connInd(0);
155 for(auto& mapel : map) {
156
159 return StatusCode::FAILURE;
160 }
161
162
165 std::ostringstream tagDetailStream;
166 tagDetailStream << atlasTagDetails << std::endl;
168
169
170 RDBAccessSvc* rdbAccessConc = dynamic_cast<RDBAccessSvc*>(rdbAccessSvc);
171 if(rdbAccessConc) {
172 std::vector<std::string> leafNodes;
174 for(size_t ii=0; ii<leafNodes.size(); ++ii) {
175 std::string nodeName = leafNodes[ii];
176 int perc = ii*100/leafNodes.size();
177 ATH_MSG_DEBUG(
"\t ** Node: " << nodeName <<
"\t" << perc <<
"%");
179 if(!childTag.empty()) {
182 mapel[nodeName] = std::move(recPtr);
183 }
184 }
185 }
186 }
187 ++connInd;
188 }
189
191 log << std::endl <<
"TAG: " <<
tag << std::endl
192 << "Different number of leaf nodes in databases! " << map[0].size() << " vs " << map[1].size() << std::endl;
193 }
194
195 bool difFound{false};
196 NodeToRecordsetMap::const_iterator
it = map[0].begin();
197 for(;
it!=map[0].end(); ++
it) {
198 if(map[1].
find(
it->first)==map[1].end()) {
199 if(!difFound) {
200 difFound = true;
201 log << std::endl <<
"TAG: " <<
tag << std::endl
202 << "Nodes existing in Session0 but missing in Session1:" << std::endl;
203 }
204 log <<
"** " <<
it->first << std::endl;
205 }
206 }
207
208 difFound = false;
210 for(;
it!=map[1].end(); ++
it) {
211 if(map[0].
find(
it->first)==map[0].end()) {
212 if(!difFound) {
213 difFound = true;
214 log << std::endl <<
"TAG: " <<
tag << std::endl
215 << "Nodes existing in Session1 but missing in Session0:" << std::endl;
216 }
217 log <<
"** " <<
it->first << std::endl;
218 }
219 }
220
221 difFound = false;
223 for(;
it!=map[0].end(); ++
it) {
224 NodeToRecordsetMap::const_iterator it1 = map[1].find(
it->first);
225 if(it1!=map[1].
end()) {
228 RDBRecordset* recConcrete0 = dynamic_cast<RDBRecordset*>(recPtr0.get());
229 RDBRecordset* recConcrete1 = dynamic_cast<RDBRecordset*>(recPtr1.get());
230 if(recConcrete0!=0
231 && recConcrete1!=0
232 && *recConcrete0!=*recConcrete1) {
233 if(!difFound) {
234 difFound = true;
235 log << std::endl <<
"TAG: " <<
tag << std::endl
236 << "Differences for common nodes:" << std::endl;
237 }
238 log <<std::endl <<
"** " <<
it->first << std::endl;
239 recConcrete0->
compare(*recConcrete1,log);
240 }
241 }
242 }
243 }
244 return StatusCode::SUCCESS;
245}
coral::AttributeList RDBTagDetails
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
#define ATLAS_THREAD_SAFE
virtual unsigned int size() const =0
IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD") override
Provides access to the Recordset object containing HVS-tagged data.
void getAllLeafNodes(std::vector< std::string > &list, const std::string &connName="ATLASDD")
void getTagDetails(RDBTagDetails &tagDetails, const std::string &tag, const std::string &connName="ATLASDD") override
std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName) override
Gets the tag name for the node by giving its parent node tag.
void compare(const RDBRecordset &rec, std::ostream &os) const
std::vector< std::string > m_connNames
std::string find(const std::string &s)
return a remapped string