6 #include "otsdaq/ConfigurationInterface/ConfigurationInterface.h"
7 #include "otsdaq/ConfigurationInterface/ConfigurationManagerRW.h"
17 void ImportSystemAliasTableGroups(
int argc,
char* argv[])
19 __COUT__ <<
"=================================================\n";
20 __COUT__ <<
"=================================================\n";
21 __COUT__ <<
"=================================================\n";
22 __COUT__ <<
"Importing External System Aliases!" << std::endl;
24 std::string prependBaseName =
"Imported";
25 const std::string groupAliasesTableName = ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
26 const std::string versionAliasesTableName = ConfigurationManager::VERSION_ALIASES_TABLE_NAME;
28 std::cout <<
"\n\nusage: Two arguments:\n\n\t otsdaq_import_system_aliases "
29 "<path_to_import_database_folder> <path_to_active_groups_file> "
30 "<import_prepend_base_name (optional)> \n\n"
31 <<
"\t\t Default values: \n\t\t\timport_prepend_base_name = \"" << prependBaseName <<
"\" "
33 <<
"\t\tfor example:\n\n"
34 <<
"\t\t\totsdaq_import_system_aliases "
35 "~/databaseToImport/filesystemdb/test_db "
36 "~/UserDataToImport/ServiceData/ActiveTableGroups.cfg"
39 std::cout <<
"\n\n\tExample active groups file content:\n\n"
40 <<
"testContext\n2\nTableEditWizBackbone\n3\ndefaultConfig\n1\n\n"
43 std::cout <<
"\n\nNote: This assumes artdaq db file type interface. "
44 <<
"The current database/ will be backed up to database_<linuxtime>/ "
45 <<
"before importing the active groups.\n\n"
49 for(
int i = 0; i < argc; i++)
50 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
54 __COUT__ <<
"Must provide at least two parameters (the database and active "
55 "groups files for the import).\n\n\n"
61 while(strlen(argv[1]) && argv[1][strlen(argv[1]) - 1] ==
'/')
62 argv[1][strlen(argv[1]) - 1] =
'\0';
65 std::string pathToImportDatabase = argv[1];
66 if(pathToImportDatabase.size() && (pathToImportDatabase[0] ==
'h' || pathToImportDatabase[0] ==
'-'))
68 __COUT__ <<
"Recognized parameter 1. as a 'help' option. Usage was printed. Exiting." << std::endl;
72 std::string pathToImportActiveGroups =
"";
74 pathToImportActiveGroups = argv[2];
76 prependBaseName = argv[3];
78 __COUTV__(pathToImportDatabase);
79 __COUTV__(pathToImportActiveGroups);
80 __COUTV__(prependBaseName);
88 setenv(
"CONFIGURATION_TYPE",
"File", 1);
89 setenv(
"CONFIGURATION_DATA_PATH", (std::string(__ENV__(
"USER_DATA")) +
"/ConfigurationDataExamples").c_str(), 1);
90 setenv(
"TABLE_INFO_PATH", (std::string(__ENV__(
"USER_DATA")) +
"/TableInfo").c_str(), 1);
94 setenv(
"SERVICE_DATA_PATH", (std::string(__ENV__(
"USER_DATA")) +
"/ServiceData").c_str(), 1);
98 setenv(
"OTSDAQ_LIB", (std::string(__ENV__(
"USER_DATA")) +
"/").c_str(), 1);
99 setenv(
"OTSDAQ_UTILITIES_LIB", (std::string(__ENV__(
"USER_DATA")) +
"/").c_str(), 1);
102 setenv(
"OTS_MAIN_PORT",
"2015", 1);
105 setenv(
"XDAQ_CONFIGURATION_DATA_PATH", (std::string(__ENV__(
"USER_DATA")) +
"/XDAQConfigurations").c_str(), 1);
106 setenv(
"XDAQ_CONFIGURATION_XML",
"otsConfigurationNoRU_CMake", 1);
171 std::map<std::string ,
173 originalGroupAliasMap;
179 std::map<std::string ,
181 originalTableAliasMap;
187 std::map< std::pair<std::string, TableGroupKey>, std::string > groupErrors;
192 __COUT__ <<
"Getting started..." << std::endl;
195 bool importedDbInPlace =
false;
197 __COUT__ <<
"Configuration manager initialized." << __E__;
199 std::string nowTime = std::to_string(time(0));
200 std::string currentDir = __ENV__(
"ARTDAQ_DATABASE_URI");
202 if(currentDir.find(
"filesystemdb://") != 0)
204 __SS__ <<
"filesystemdb:// was not found in $ARTDAQ_DATABASE_URI!" << std::endl;
205 __COUT_ERR__ <<
"\n" << ss.str();
209 currentDir = currentDir.substr(std::string(
"filesystemdb://").length());
210 while(currentDir.length() && currentDir[currentDir.length() - 1] ==
'/')
211 currentDir = currentDir.substr(0, currentDir.length() - 1);
213 __COUTV__(currentDir);
215 std::string backupDir = currentDir +
"_" + nowTime;
216 std::string importDir = pathToImportDatabase +
"_" + nowTime;
217 std::string tmpCurrentDir = currentDir +
"_tmp_" + nowTime;
221 std::map<std::string , std::map<std::string , TableVersion >> existingTableAliases =
222 cfgMgr->ConfigurationManager::getVersionAliases();
223 std::map<std::string , std::pair<std::string , TableGroupKey>> existingGroupAliases = cfgMgr->getActiveGroupAliases();
243 __COUT__ <<
"Backing up current database at '" << currentDir <<
"' to '" << backupDir <<
"'" << __E__;
244 std::system((
"cp -r " + currentDir +
" " + backupDir).c_str());
246 __COUT__ <<
"Backing up current database at '" << pathToImportDatabase <<
"' to '" << importDir <<
"'" << __E__;
247 std::system((
"cp -r " + pathToImportDatabase +
" " + importDir).c_str());
251 __COUT__ <<
"Swap to import-db" << std::endl;
252 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
254 __SS__ <<
"Problem!" << std::endl;
257 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
259 __SS__ <<
"Problem!" << std::endl;
262 importedDbInPlace =
true;
268 cfgMgr->restoreActiveTableGroups(
true , pathToImportActiveGroups);
271 std::map<std::string, std::pair<std::string, TableGroupKey>> activeGroupsMap = cfgMgr->getActiveTableGroups();
273 for(
const auto& activeGroup : activeGroupsMap)
275 if(activeGroup.second.second.isInvalid())
277 if(activeGroup.second.first ==
"")
280 __COUTV__(activeGroup.second.first);
281 __COUTV__(activeGroup.second.second);
283 groupSet.insert(std::pair<std::pair<std::string, TableGroupKey>, TableGroupKey>(
284 std::pair<std::string, TableGroupKey>(activeGroup.second.first, activeGroup.second.second), TableGroupKey()));
288 std::map<std::string, TableVersion> activeVersions = cfgMgr->getActiveVersions();
289 if(activeVersions.find(groupAliasesTableName) == activeVersions.end())
291 __SS__ <<
"\nActive version of " << groupAliasesTableName <<
" missing! " << groupAliasesTableName
292 <<
" is a required member of the Backbone configuration group."
293 <<
"\n\nLikely you need to activate a valid Backbone group." << std::endl;
296 if(activeVersions.find(versionAliasesTableName) == activeVersions.end())
298 __SS__ <<
"\nActive version of " << versionAliasesTableName <<
" missing! " << versionAliasesTableName
299 <<
" is a required member of the Backbone configuration group."
300 <<
"\n\nLikely you need to activate a valid Backbone group." << std::endl;
304 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs = cfgMgr->getNode(groupAliasesTableName).getChildren();
305 std::string aliasName;
306 for(
auto& aliasPair : aliasNodePairs)
308 if(TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString()).isInvalid())
310 if(aliasPair.second.getNode(
"GroupName").getValueAsString() ==
"")
313 aliasName = aliasPair.second.getNode(
"GroupKeyAlias").getValueAsString();
317 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
319 aliasName = prependBaseName + aliasName;
320 __COUTV__(aliasName);
321 __COUTV__(aliasPair.second.getNode(
"GroupName").getValueAsString());
322 __COUTV__(aliasPair.second.getNode(
"GroupKey").getValueAsString());
326 if(existingGroupAliases.find(aliasName) != existingGroupAliases.end())
328 __SS__ <<
"Conflicting group alias '" << aliasName <<
"' found!" << __E__;
332 groupSet.insert(std::pair<std::pair<std::string, TableGroupKey>, TableGroupKey>(
333 std::pair<std::string, TableGroupKey>(aliasPair.second.getNode(
"GroupName").getValueAsString(),
334 TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString())),
337 originalGroupAliasMap[aliasName] = std::pair<std::string, TableGroupKey>(aliasPair.second.getNode(
"GroupName").getValueAsString(),
338 TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString()));
341 aliasNodePairs = cfgMgr->getNode(versionAliasesTableName).getChildren();
342 for(
auto& aliasPair : aliasNodePairs)
344 if(TableVersion(aliasPair.second.getNode(
"Version").getValueAsString()).isInvalid())
346 if(aliasPair.second.getNode(
"TableName").getValueAsString() ==
"")
348 aliasName = aliasPair.second.getNode(
"VersionAlias").getValueAsString();
352 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
354 aliasName = prependBaseName + aliasName;
355 __COUTV__(aliasPair.second.getNode(
"TableName").getValueAsString());
356 __COUTV__(aliasName);
357 __COUTV__(aliasPair.second.getNode(
"Version").getValueAsString());
361 if(existingTableAliases.find(aliasName) != existingTableAliases.end())
363 __SS__ <<
"Conflicting table version alias '" << aliasName <<
"' found!" << __E__;
367 originalTableAliasMap[aliasName] = std::pair<std::string, TableVersion>(aliasPair.second.getNode(
"TableName").getValueAsString(),
368 TableVersion(aliasPair.second.getNode(
"Version").getValueAsString()));
371 catch(
const std::runtime_error& e)
373 __COUT_ERR__ <<
"There was a fatal error: " << e.what() << __E__;
375 __COUT__ << std::endl;
376 __COUT__ << std::endl;
377 __COUT__ <<
"Run the following to return to your previous database structure:" << std::endl;
378 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n" << std::endl;
379 __COUT__ << std::endl;
380 __COUT__ << std::endl;
384 __COUTV__(StringMacros::mapToString(existingGroupAliases));
385 __COUTV__(StringMacros::mapToString(existingTableAliases));
387 __COUT__ << std::endl;
388 __COUT__ << std::endl;
389 __COUT__ <<
"Identified groups:" << std::endl;
390 for(
auto& group : groupSet)
391 __COUT__ <<
"\t" << group.first.first <<
" " << group.first.second << std::endl;
392 __COUT__ << std::endl;
393 __COUT__ << std::endl;
395 __COUT__ <<
"Identified group aliases:" << std::endl;
396 for(
auto& groupAlias : originalGroupAliasMap)
397 __COUT__ <<
"\t" << groupAlias.first <<
" ==> " << groupAlias.second.first <<
"-" << groupAlias.second.second << std::endl;
398 __COUT__ << std::endl;
399 __COUT__ << std::endl;
407 TableVersion newVersion;
408 TableGroupKey newKey;
411 std::string accumulateErrors =
"";
414 std::map<std::string, TableVersion> memberMap;
415 std::map<std::string , std::string > groupAliases;
416 std::string groupComment;
417 std::string groupAuthor;
418 std::string groupCreateTime;
419 time_t groupCreateTime_t;
420 TableBase* groupMetadataTable = cfgMgr->getMetadataTable();
422 __COUT__ <<
"Proceeding with handling of identified groups..." << __E__;
425 for(
auto& groupPair : groupSet)
434 __COUTV__(importedDbInPlace);
436 if(!importedDbInPlace)
438 __COUT__ <<
"Swap to import-db" << std::endl;
439 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
441 __SS__ <<
"Problem!" << std::endl;
444 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
446 __SS__ <<
"Problem!" << std::endl;
449 importedDbInPlace =
true;
455 __COUT__ <<
"****************************" << std::endl;
456 __COUT__ <<
"Loading members for " << groupPair.first.first <<
"(" << groupPair.first.second <<
")" << std::endl;
463 cfgMgr->loadTableGroup(groupPair.first.first,
464 groupPair.first.second,
476 catch(std::runtime_error& e)
478 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first <<
"(" << groupPair.first.second <<
")" << std::endl;
479 __COUT__ << e.what() << std::endl;
484 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first <<
"(" << groupPair.first.second <<
")" << std::endl;
500 groupErrors.insert(std::pair<std::pair<std::string, TableGroupKey>, std::string>(
501 std::pair<std::string, TableGroupKey>(groupPair.first.first, groupPair.first.second),
"Error caught loading the group."));
506 if(importedDbInPlace)
508 __COUT__ <<
"Swap to current-db" << std::endl;
509 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
511 __SS__ <<
"Problem!" << std::endl;
514 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
516 __SS__ <<
"Problem!" << std::endl;
519 importedDbInPlace =
false;
527 for(
auto& memberPair : memberMap)
529 __COUT__ << memberPair.first <<
":v" << memberPair.second << std::endl;
533 if(newTableVersionMap.find(std::pair<std::string, TableVersion>(memberPair.first, memberPair.second)) != newTableVersionMap.end())
535 __COUT__ <<
"Table was already modified!" << std::endl;
536 memberPair.second = newTableVersionMap[std::pair<std::string, TableVersion>(memberPair.first, memberPair.second)];
537 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v" << memberPair.second << std::endl;
543 config = cfgMgr->getTableByName(memberPair.first);
544 cfgView = config->getViewP();
546 newVersion = TableVersion::getNextVersion(theInterface_->findLatestVersion(config));
547 __COUTV__(newVersion);
548 cfgView->setVersion(newVersion);
549 theInterface_->saveActiveVersion(config);
558 newTableVersionMap.insert(std::pair<std::pair<std::string, TableVersion>, TableVersion>(
559 std::pair<std::string, TableVersion>(memberPair.first, memberPair.second), newVersion));
561 memberPair.second = newVersion;
563 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v" << memberPair.second << std::endl;
566 __COUT__ <<
"Member map completed" << __E__;
567 __COUTV__(StringMacros::mapToString(memberMap));
572 __COUTV__(StringMacros::mapToString(groupAliases));
573 __COUTV__(groupComment);
574 __COUTV__(groupAuthor);
575 __COUTV__(groupCreateTime);
576 sscanf(groupCreateTime.c_str(),
"%ld", &groupCreateTime_t);
577 __COUTV__(groupCreateTime_t);
581 while(groupMetadataTable->getViewP()->getNumberOfRows() > 1)
582 groupMetadataTable->getViewP()->deleteRow(0);
583 if(groupMetadataTable->getViewP()->getNumberOfRows() == 0)
584 groupMetadataTable->getViewP()->addRow();
588 groupMetadataTable->getViewP()->setValue(
589 StringMacros::mapToString(groupAliases,
"," ,
":" ), 0, ConfigurationManager::METADATA_COL_ALIASES);
590 groupMetadataTable->getViewP()->setValue(groupComment, 0, ConfigurationManager::METADATA_COL_COMMENT);
591 groupMetadataTable->getViewP()->setValue(groupAuthor, 0, ConfigurationManager::METADATA_COL_AUTHOR);
592 groupMetadataTable->getViewP()->setValue(groupCreateTime_t, 0, ConfigurationManager::METADATA_COL_TIMESTAMP);
595 newVersion = TableVersion::getNextVersion(theInterface_->findLatestVersion(groupMetadataTable));
596 __COUTV__(newVersion);
597 groupMetadataTable->getViewP()->setVersion(newVersion);
598 theInterface_->saveActiveVersion(groupMetadataTable);
601 memberMap[groupMetadataTable->getTableName()] = groupMetadataTable->getViewVersion();
605 newKey = TableGroupKey::getNextKey(theInterface_->findLatestGroupKey(groupPair.first.first));
610 theInterface_->saveTableGroup(memberMap, TableGroupKey::getFullGroupString(groupPair.first.first, newKey));
613 groupPair.second = newKey;
615 catch(std::runtime_error& e)
617 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" (" << groupPair.first.second <<
") " << std::endl;
618 __COUT__ << e.what() << std::endl;
620 groupErrors.insert(std::pair<std::pair<std::string, TableGroupKey>, std::string>(
621 std::pair<std::string, TableGroupKey>(groupPair.first.first, groupPair.first.second),
"Error caught saving the group."));
625 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" (" << groupPair.first.second <<
") " << std::endl;
627 groupErrors.insert(std::pair<std::pair<std::string, TableGroupKey>, std::string>(
628 std::pair<std::string, TableGroupKey>(groupPair.first.first, groupPair.first.second),
"Error caught saving the group."));
636 __COUT__ <<
"Completed group and table saving for " << count <<
" groups." << __E__;
637 __COUT__ <<
"Created tables:" << std::endl;
638 for(
auto& tablePair : newTableVersionMap)
639 __COUT__ <<
"\t" << tablePair.first.first <<
"-v" << tablePair.first.second <<
" ==> " << tablePair.second << std::endl;
640 __COUT__ << std::endl;
641 __COUT__ << std::endl;
642 __COUT__ <<
"Created groups:" << std::endl;
643 for(
auto& group : groupSet)
644 __COUT__ <<
"\t" << group.first.first <<
"(" << group.first.second <<
") ==> " << group.second << std::endl;
648 if(importedDbInPlace)
650 __COUT__ <<
"Swap to current-db" << std::endl;
651 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
653 __SS__ <<
"Problem!" << std::endl;
656 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
658 __SS__ <<
"Problem!" << std::endl;
661 importedDbInPlace =
false;
666 FILE* fp = fopen((currentDir +
"/README_otsdaq_import.txt").c_str(),
"a");
669 __COUT__ <<
"\tError opening README file!" << std::endl;
677 timeinfo = localtime(&rawtime);
678 strftime(buffer, 200,
"%b %d, %Y %I:%M:%S%p %Z", timeinfo);
681 "This database...\t %s \t received an import from...\t %s \t at this "
682 "time \t %lu \t %s\n\n",
684 pathToImportDatabase.c_str(),
694 cfgMgr->restoreActiveTableGroups(
true );
704 __COUT__ <<
"Modifying the active Backbone table to reflect new table versions and "
713 std::string activeBackboneGroupName = cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
714 cfgMgr->loadTableGroup(
715 activeBackboneGroupName, cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::BACKBONE_TYPE),
true, &memberMap, 0, &accumulateErrors);
717 std::map<std::string, TableVersion> activeMap = cfgMgr->getActiveVersions();
720 if(activeMap.find(groupAliasesTableName) != activeMap.end())
722 __COUT__ <<
"\n\nModifying " << groupAliasesTableName << std::endl;
723 config = cfgMgr->getTableByName(groupAliasesTableName);
724 cfgView = config->getViewP();
726 unsigned int col0 = cfgView->findCol(
"GroupKeyAlias");
727 unsigned int col1 = cfgView->findCol(
"GroupName");
728 unsigned int col2 = cfgView->findCol(
"GroupKey");
736 for(
auto& aliasPair : originalGroupAliasMap)
738 auto groupIt = groupSet.find(std::pair<std::string, TableGroupKey>(aliasPair.second.first, aliasPair.second.second));
740 if(groupIt == groupSet.end())
742 __COUT__ <<
"Error! Could not find the new entry for the original group " << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
746 row = cfgView->addRow(
"import_aliases",
true );
747 cfgView->setValue(aliasPair.first, row, col0);
748 cfgView->setValue(aliasPair.second.first, row, col1);
749 cfgView->setValue(groupIt->second.toString(), row, col2);
756 if(activeMap.find(versionAliasesTableName) != activeMap.end())
758 __COUT__ <<
"\n\nModifying " << versionAliasesTableName << std::endl;
759 config = cfgMgr->getTableByName(versionAliasesTableName);
760 cfgView = config->getViewP();
761 unsigned int col0 = cfgView->findCol(
"VersionAlias");
762 unsigned int col1 = cfgView->findCol(
"TableName");
763 unsigned int col2 = cfgView->findCol(
"Version");
772 for(
auto& aliasPair : originalTableAliasMap)
774 auto tableIt = newTableVersionMap.find(std::pair<std::string, TableVersion>(aliasPair.second.first, aliasPair.second.second));
776 if(tableIt == newTableVersionMap.end())
778 __COUT__ <<
"Error! Could not find the new entry for the original table " << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
782 row = cfgView->addRow(
"import_aliases",
true );
783 cfgView->setValue(aliasPair.first, row, col0);
784 cfgView->setValue(aliasPair.second.first, row, col1);
785 cfgView->setValue(tableIt->second.toString(), row, col2);
794 config = cfgMgr->getTableByName(groupAliasesTableName);
795 cfgView = config->getViewP();
796 newVersion = TableVersion::getNextVersion(theInterface_->findLatestVersion(config));
797 __COUTV__(newVersion);
798 cfgView->setVersion(newVersion);
799 theInterface_->saveActiveVersion(config);
801 memberMap[groupAliasesTableName] = newVersion;
804 __COUT__ <<
"\t to...\t" << groupAliasesTableName <<
":v" << memberMap[groupAliasesTableName] << std::endl;
806 __COUT__ << versionAliasesTableName <<
":v" << memberMap[versionAliasesTableName] << std::endl;
808 config = cfgMgr->getTableByName(versionAliasesTableName);
809 cfgView = config->getViewP();
810 newVersion = TableVersion::getNextVersion(theInterface_->findLatestVersion(config));
811 __COUTV__(newVersion);
812 cfgView->setVersion(newVersion);
813 theInterface_->saveActiveVersion(config);
815 memberMap[versionAliasesTableName] = newVersion;
817 __COUT__ <<
"\t to...\t" << versionAliasesTableName <<
":v" << memberMap[versionAliasesTableName] << std::endl;
819 __COUT__ <<
"Backbone member map completed" << __E__;
820 __COUTV__(StringMacros::mapToString(memberMap));
822 newKey = TableGroupKey::getNextKey(theInterface_->findLatestGroupKey(activeBackboneGroupName));
827 theInterface_->saveTableGroup(memberMap, TableGroupKey::getFullGroupString(activeBackboneGroupName, newKey));
829 std::string renameFile = ConfigurationManager::ACTIVE_GROUPS_FILENAME +
"." + nowTime;
830 rename(ConfigurationManager::ACTIVE_GROUPS_FILENAME.c_str(), renameFile.c_str());
832 __COUT__ <<
"Backing up '" << ConfigurationManager::ACTIVE_GROUPS_FILENAME <<
"' to ... '" << renameFile <<
"'" << std::endl;
834 cfgMgr->activateTableGroup(activeBackboneGroupName,
838 catch(
const std::runtime_error& e)
840 __COUT_ERR__ <<
"There was a fatal error during backbone modification: " << e.what() << __E__;
847 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups:" << std::endl;
848 for(
const auto& group : groupSet)
849 __COUT__ <<
"\t" << group.first.first <<
": " << group.first.second <<
" => " << group.second << std::endl;
850 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups end." << std::endl;
854 __COUT__ <<
"End of Importing Active Table Groups!\n\n\n" << std::endl;
856 __COUT__ <<
"****************************" << std::endl;
857 __COUT__ <<
"There were " << groupSet.size() <<
" groups considered, and there were " << groupErrors.size() <<
" errors found handling those groups."
859 __COUT__ <<
"The following errors were found handling the groups:" << std::endl;
860 for(
auto& groupErr : groupErrors)
861 __COUT__ <<
"\t" << groupErr.first.first <<
" " << groupErr.first.second <<
": \t" << groupErr.second << std::endl;
862 __COUT__ <<
"End of errors.\n\n" << std::endl;
864 __COUT__ <<
"Run the following to return to your previous database structure:" << std::endl;
865 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n" << std::endl;
870 int main(
int argc,
char* argv[])
872 ImportSystemAliasTableGroups(argc, argv);