6 #include "otsdaq-core/ConfigurationInterface/ConfigurationInterface.h"
7 #include "otsdaq-core/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 =
26 ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
27 const std::string versionAliasesTableName =
28 ConfigurationManager::VERSION_ALIASES_TABLE_NAME;
30 std::cout <<
"\n\nusage: Two arguments:\n\n\t otsdaq_import_system_aliases "
31 "<path_to_import_database_folder> <path_to_active_groups_file> "
32 "<import_prepend_base_name (optional)> \n\n"
33 <<
"\t\t Default values: \n\t\t\timport_prepend_base_name = \""
34 << prependBaseName <<
"\" "
36 <<
"\t\tfor example:\n\n"
37 <<
"\t\t\totsdaq_import_system_aliases "
38 "~/databaseToImport/filesystemdb/test_db "
39 "~/UserDataToImport/ServiceData/ActiveTableGroups.cfg"
42 std::cout <<
"\n\n\tExample active groups file content:\n\n"
43 <<
"testContext\n2\nTableEditWizBackbone\n3\ndefaultConfig\n1\n\n"
46 std::cout <<
"\n\nNote: This assumes artdaq db file type interface. "
47 <<
"The current database/ will be backed up to database_<linuxtime>/ "
48 <<
"before importing the active groups.\n\n"
52 for(
int i = 0; i < argc; i++)
53 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
57 __COUT__ <<
"Must provide at least two parameters (the database and active "
58 "groups files for the import).\n\n\n"
64 while(strlen(argv[1]) && argv[1][strlen(argv[1]) - 1] ==
'/')
65 argv[1][strlen(argv[1]) - 1] =
'\0';
68 std::string pathToImportDatabase = argv[1];
69 if(pathToImportDatabase.size() &&
70 (pathToImportDatabase[0] ==
'h' || pathToImportDatabase[0] ==
'-'))
73 <<
"Recognized parameter 1. as a 'help' option. Usage was printed. Exiting."
78 std::string pathToImportActiveGroups =
"";
80 pathToImportActiveGroups = argv[2];
82 prependBaseName = argv[3];
84 __COUTV__(pathToImportDatabase);
85 __COUTV__(pathToImportActiveGroups);
86 __COUTV__(prependBaseName);
94 setenv(
"CONFIGURATION_TYPE",
"File", 1);
95 setenv(
"CONFIGURATION_DATA_PATH",
96 (std::string(getenv(
"USER_DATA")) +
"/ConfigurationDataExamples").c_str(),
99 "TABLE_INFO_PATH", (std::string(getenv(
"USER_DATA")) +
"/TableInfo").c_str(), 1);
103 setenv(
"SERVICE_DATA_PATH",
104 (std::string(getenv(
"USER_DATA")) +
"/ServiceData").c_str(),
109 setenv(
"OTSDAQ_LIB", (std::string(getenv(
"USER_DATA")) +
"/").c_str(), 1);
110 setenv(
"OTSDAQ_UTILITIES_LIB", (std::string(getenv(
"USER_DATA")) +
"/").c_str(), 1);
113 setenv(
"OTS_MAIN_PORT",
"2015", 1);
116 setenv(
"XDAQ_CONFIGURATION_DATA_PATH",
117 (std::string(getenv(
"USER_DATA")) +
"/XDAQConfigurations").c_str(),
119 setenv(
"XDAQ_CONFIGURATION_XML",
"otsConfigurationNoRU_CMake", 1);
184 std::map<std::string ,
186 originalGroupAliasMap;
192 std::map<std::string ,
194 originalTableAliasMap;
200 std::map< std::pair<std::string, TableGroupKey>,
207 __COUT__ <<
"Getting started..." << std::endl;
210 bool importedDbInPlace =
false;
212 __COUT__ <<
"Configuration manager initialized." << __E__;
214 std::string nowTime = std::to_string(time(0));
215 std::string currentDir = getenv(
"ARTDAQ_DATABASE_URI");
217 if(currentDir.find(
"filesystemdb://") != 0)
219 __SS__ <<
"filesystemdb:// was not found in $ARTDAQ_DATABASE_URI!" << std::endl;
220 __COUT_ERR__ <<
"\n" << ss.str();
224 currentDir = currentDir.substr(std::string(
"filesystemdb://").length());
225 while(currentDir.length() &&
226 currentDir[currentDir.length() - 1] ==
'/')
227 currentDir = currentDir.substr(0, currentDir.length() - 1);
229 __COUTV__(currentDir);
231 std::string backupDir = currentDir +
"_" + nowTime;
232 std::string importDir = pathToImportDatabase +
"_" + nowTime;
233 std::string tmpCurrentDir = currentDir +
"_tmp_" + nowTime;
237 std::map<std::string ,
238 std::map<std::string , TableVersion >>
239 existingTableAliases = cfgMgr->ConfigurationManager::getVersionAliases();
240 std::map<std::string , std::pair<std::string , TableGroupKey>>
241 existingGroupAliases = cfgMgr->getActiveGroupAliases();
261 __COUT__ <<
"Backing up current database at '" << currentDir <<
"' to '"
262 << backupDir <<
"'" << __E__;
263 std::system((
"cp -r " + currentDir +
" " + backupDir).c_str());
265 __COUT__ <<
"Backing up current database at '" << pathToImportDatabase <<
"' to '"
266 << importDir <<
"'" << __E__;
267 std::system((
"cp -r " + pathToImportDatabase +
" " + importDir).c_str());
271 __COUT__ <<
"Swap to import-db" << std::endl;
272 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
274 __SS__ <<
"Problem!" << std::endl;
277 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
279 __SS__ <<
"Problem!" << std::endl;
282 importedDbInPlace =
true;
288 cfgMgr->restoreActiveTableGroups(
true , pathToImportActiveGroups);
291 std::map<std::string, std::pair<std::string, TableGroupKey>> activeGroupsMap =
292 cfgMgr->getActiveTableGroups();
294 for(
const auto& activeGroup : activeGroupsMap)
296 if(activeGroup.second.second.isInvalid())
298 if(activeGroup.second.first ==
"")
301 __COUTV__(activeGroup.second.first);
302 __COUTV__(activeGroup.second.second);
305 std::pair<std::pair<std::string, TableGroupKey>, TableGroupKey>(
306 std::pair<std::string, TableGroupKey>(activeGroup.second.first,
307 activeGroup.second.second),
312 std::map<std::string, TableVersion> activeVersions = cfgMgr->getActiveVersions();
313 if(activeVersions.find(groupAliasesTableName) == activeVersions.end())
315 __SS__ <<
"\nActive version of " << groupAliasesTableName <<
" missing! "
316 << groupAliasesTableName
317 <<
" is a required member of the Backbone configuration group."
318 <<
"\n\nLikely you need to activate a valid Backbone group."
322 if(activeVersions.find(versionAliasesTableName) == activeVersions.end())
324 __SS__ <<
"\nActive version of " << versionAliasesTableName <<
" missing! "
325 << versionAliasesTableName
326 <<
" is a required member of the Backbone configuration group."
327 <<
"\n\nLikely you need to activate a valid Backbone group."
332 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
333 cfgMgr->getNode(groupAliasesTableName).getChildren();
334 std::string aliasName;
335 for(
auto& aliasPair : aliasNodePairs)
337 if(TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString())
340 if(aliasPair.second.getNode(
"GroupName").getValueAsString() ==
"")
343 aliasName = aliasPair.second.getNode(
"GroupKeyAlias").getValueAsString();
347 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
349 aliasName = prependBaseName + aliasName;
350 __COUTV__(aliasName);
351 __COUTV__(aliasPair.second.getNode(
"GroupName").getValueAsString());
352 __COUTV__(aliasPair.second.getNode(
"GroupKey").getValueAsString());
356 if(existingGroupAliases.find(aliasName) != existingGroupAliases.end())
358 __SS__ <<
"Conflicting group alias '" << aliasName <<
"' found!" << __E__;
363 std::pair<std::pair<std::string, TableGroupKey>, TableGroupKey>(
364 std::pair<std::string, TableGroupKey>(
365 aliasPair.second.getNode(
"GroupName").getValueAsString(),
367 aliasPair.second.getNode(
"GroupKey").getValueAsString())),
370 originalGroupAliasMap[aliasName] = std::pair<std::string, TableGroupKey>(
371 aliasPair.second.getNode(
"GroupName").getValueAsString(),
372 TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString()));
375 aliasNodePairs = cfgMgr->getNode(versionAliasesTableName).getChildren();
376 for(
auto& aliasPair : aliasNodePairs)
378 if(TableVersion(aliasPair.second.getNode(
"Version").getValueAsString())
381 if(aliasPair.second.getNode(
"TableName").getValueAsString() ==
"")
383 aliasName = aliasPair.second.getNode(
"VersionAlias").getValueAsString();
387 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
389 aliasName = prependBaseName + aliasName;
390 __COUTV__(aliasPair.second.getNode(
"TableName").getValueAsString());
391 __COUTV__(aliasName);
392 __COUTV__(aliasPair.second.getNode(
"Version").getValueAsString());
396 if(existingTableAliases.find(aliasName) != existingTableAliases.end())
398 __SS__ <<
"Conflicting table version alias '" << aliasName <<
"' found!"
403 originalTableAliasMap[aliasName] = std::pair<std::string, TableVersion>(
404 aliasPair.second.getNode(
"TableName").getValueAsString(),
405 TableVersion(aliasPair.second.getNode(
"Version").getValueAsString()));
408 catch(
const std::runtime_error& e)
410 __COUT_ERR__ <<
"There was a fatal error: " << e.what() << __E__;
412 __COUT__ << std::endl;
413 __COUT__ << std::endl;
414 __COUT__ <<
"Run the following to return to your previous database structure:"
416 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n"
418 __COUT__ << std::endl;
419 __COUT__ << std::endl;
423 __COUTV__(StringMacros::mapToString(existingGroupAliases));
424 __COUTV__(StringMacros::mapToString(existingTableAliases));
426 __COUT__ << std::endl;
427 __COUT__ << std::endl;
428 __COUT__ <<
"Identified groups:" << std::endl;
429 for(
auto& group : groupSet)
430 __COUT__ <<
"\t" << group.first.first <<
" " << group.first.second << std::endl;
431 __COUT__ << std::endl;
432 __COUT__ << std::endl;
434 __COUT__ <<
"Identified group aliases:" << std::endl;
435 for(
auto& groupAlias : originalGroupAliasMap)
436 __COUT__ <<
"\t" << groupAlias.first <<
" ==> " << groupAlias.second.first <<
"-"
437 << groupAlias.second.second << std::endl;
438 __COUT__ << std::endl;
439 __COUT__ << std::endl;
448 TableVersion newVersion;
449 TableGroupKey newKey;
452 std::string accumulateErrors =
"";
455 std::map<std::string, TableVersion> memberMap;
456 std::map<std::string , std::string > groupAliases;
457 std::string groupComment;
458 std::string groupAuthor;
459 std::string groupCreateTime;
460 time_t groupCreateTime_t;
461 TableBase* groupMetadataTable = cfgMgr->getMetadataTable();
463 __COUT__ <<
"Proceeding with handling of identified groups..." << __E__;
466 for(
auto& groupPair : groupSet)
475 __COUTV__(importedDbInPlace);
477 if(!importedDbInPlace)
479 __COUT__ <<
"Swap to import-db" << std::endl;
480 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
482 __SS__ <<
"Problem!" << std::endl;
485 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
487 __SS__ <<
"Problem!" << std::endl;
490 importedDbInPlace =
true;
496 __COUT__ <<
"****************************" << std::endl;
497 __COUT__ <<
"Loading members for " << groupPair.first.first <<
"("
498 << groupPair.first.second <<
")" << std::endl;
505 cfgMgr->loadTableGroup(groupPair.first.first,
506 groupPair.first.second,
518 catch(std::runtime_error& e)
520 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
521 <<
"(" << groupPair.first.second <<
")" << std::endl;
522 __COUT__ << e.what() << std::endl;
527 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
528 <<
"(" << groupPair.first.second <<
")" << std::endl;
545 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
546 std::pair<std::string, TableGroupKey>(groupPair.first.first,
547 groupPair.first.second),
548 "Error caught loading the group."));
553 if(importedDbInPlace)
555 __COUT__ <<
"Swap to current-db" << std::endl;
556 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
558 __SS__ <<
"Problem!" << std::endl;
561 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
563 __SS__ <<
"Problem!" << std::endl;
566 importedDbInPlace =
false;
574 for(
auto& memberPair : memberMap)
576 __COUT__ << memberPair.first <<
":v" << memberPair.second << std::endl;
580 if(newTableVersionMap.find(std::pair<std::string, TableVersion>(
581 memberPair.first, memberPair.second)) != newTableVersionMap.end())
583 __COUT__ <<
"Table was already modified!" << std::endl;
585 newTableVersionMap[std::pair<std::string, TableVersion>(
586 memberPair.first, memberPair.second)];
587 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v"
588 << memberPair.second << std::endl;
594 config = cfgMgr->getTableByName(memberPair.first);
595 cfgView = config->getViewP();
597 newVersion = TableVersion::getNextVersion(
598 theInterface_->findLatestVersion(config));
599 __COUTV__(newVersion);
600 cfgView->setVersion(newVersion);
601 theInterface_->saveActiveVersion(config);
610 newTableVersionMap.insert(
611 std::pair<std::pair<std::string, TableVersion>, TableVersion>(
612 std::pair<std::string, TableVersion>(memberPair.first,
616 memberPair.second = newVersion;
618 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v" << memberPair.second
622 __COUT__ <<
"Member map completed" << __E__;
623 __COUTV__(StringMacros::mapToString(memberMap));
628 __COUTV__(StringMacros::mapToString(groupAliases));
629 __COUTV__(groupComment);
630 __COUTV__(groupAuthor);
631 __COUTV__(groupCreateTime);
632 sscanf(groupCreateTime.c_str(),
"%ld", &groupCreateTime_t);
633 __COUTV__(groupCreateTime_t);
637 while(groupMetadataTable->getViewP()->getNumberOfRows() > 1)
638 groupMetadataTable->getViewP()->deleteRow(0);
639 if(groupMetadataTable->getViewP()->getNumberOfRows() == 0)
640 groupMetadataTable->getViewP()->addRow();
644 groupMetadataTable->getViewP()->setValue(
645 StringMacros::mapToString(
646 groupAliases,
"," ,
":" ),
648 ConfigurationManager::METADATA_COL_ALIASES);
649 groupMetadataTable->getViewP()->setValue(
650 groupComment, 0, ConfigurationManager::METADATA_COL_COMMENT);
651 groupMetadataTable->getViewP()->setValue(
652 groupAuthor, 0, ConfigurationManager::METADATA_COL_AUTHOR);
653 groupMetadataTable->getViewP()->setValue(
654 groupCreateTime_t, 0, ConfigurationManager::METADATA_COL_TIMESTAMP);
657 newVersion = TableVersion::getNextVersion(
658 theInterface_->findLatestVersion(groupMetadataTable));
659 __COUTV__(newVersion);
660 groupMetadataTable->getViewP()->setVersion(newVersion);
661 theInterface_->saveActiveVersion(groupMetadataTable);
664 memberMap[groupMetadataTable->getTableName()] =
665 groupMetadataTable->getViewVersion();
669 newKey = TableGroupKey::getNextKey(
670 theInterface_->findLatestGroupKey(groupPair.first.first));
675 theInterface_->saveTableGroup(
677 TableGroupKey::getFullGroupString(groupPair.first.first, newKey));
680 groupPair.second = newKey;
682 catch(std::runtime_error& e)
684 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
685 << groupPair.first.second <<
") " << std::endl;
686 __COUT__ << e.what() << std::endl;
689 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
690 std::pair<std::string, TableGroupKey>(groupPair.first.first,
691 groupPair.first.second),
692 "Error caught saving the group."));
696 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
697 << groupPair.first.second <<
") " << std::endl;
700 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
701 std::pair<std::string, TableGroupKey>(groupPair.first.first,
702 groupPair.first.second),
703 "Error caught saving the group."));
711 __COUT__ <<
"Completed group and table saving for " << count <<
" groups." << __E__;
712 __COUT__ <<
"Created tables:" << std::endl;
713 for(
auto& tablePair : newTableVersionMap)
714 __COUT__ <<
"\t" << tablePair.first.first <<
"-v" << tablePair.first.second
715 <<
" ==> " << tablePair.second << std::endl;
716 __COUT__ << std::endl;
717 __COUT__ << std::endl;
718 __COUT__ <<
"Created groups:" << std::endl;
719 for(
auto& group : groupSet)
720 __COUT__ <<
"\t" << group.first.first <<
"(" << group.first.second <<
") ==> "
721 << group.second << std::endl;
725 if(importedDbInPlace)
727 __COUT__ <<
"Swap to current-db" << std::endl;
728 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
730 __SS__ <<
"Problem!" << std::endl;
733 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
735 __SS__ <<
"Problem!" << std::endl;
738 importedDbInPlace =
false;
743 FILE* fp = fopen((currentDir +
"/README_otsdaq_import.txt").c_str(),
"a");
746 __COUT__ <<
"\tError opening README file!" << std::endl;
754 timeinfo = localtime(&rawtime);
755 strftime(buffer, 200,
"%b %d, %Y %I:%M:%S%p %Z", timeinfo);
758 "This database...\t %s \t received an import from...\t %s \t at this "
759 "time \t %lu \t %s\n\n",
761 pathToImportDatabase.c_str(),
771 cfgMgr->restoreActiveTableGroups(
true );
781 __COUT__ <<
"Modifying the active Backbone table to reflect new table versions and "
790 std::string activeBackboneGroupName =
791 cfgMgr->getActiveGroupName(ConfigurationManager::ACTIVE_GROUP_NAME_BACKBONE);
792 cfgMgr->loadTableGroup(
793 activeBackboneGroupName,
794 cfgMgr->getActiveGroupKey(ConfigurationManager::ACTIVE_GROUP_NAME_BACKBONE),
800 std::map<std::string, TableVersion> activeMap = cfgMgr->getActiveVersions();
803 if(activeMap.find(groupAliasesTableName) != activeMap.end())
805 __COUT__ <<
"\n\nModifying " << groupAliasesTableName << std::endl;
806 config = cfgMgr->getTableByName(groupAliasesTableName);
807 cfgView = config->getViewP();
809 unsigned int col0 = cfgView->findCol(
"GroupKeyAlias");
810 unsigned int col1 = cfgView->findCol(
"GroupName");
811 unsigned int col2 = cfgView->findCol(
"GroupKey");
819 for(
auto& aliasPair : originalGroupAliasMap)
821 auto groupIt = groupSet.find(std::pair<std::string, TableGroupKey>(
822 aliasPair.second.first, aliasPair.second.second));
824 if(groupIt == groupSet.end())
827 <<
"Error! Could not find the new entry for the original group "
828 << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
832 row = cfgView->addRow(
"import_aliases",
true );
833 cfgView->setValue(aliasPair.first, row, col0);
834 cfgView->setValue(aliasPair.second.first, row, col1);
835 cfgView->setValue(groupIt->second.toString(), row, col2);
842 if(activeMap.find(versionAliasesTableName) != activeMap.end())
844 __COUT__ <<
"\n\nModifying " << versionAliasesTableName << std::endl;
845 config = cfgMgr->getTableByName(versionAliasesTableName);
846 cfgView = config->getViewP();
847 unsigned int col0 = cfgView->findCol(
"VersionAlias");
848 unsigned int col1 = cfgView->findCol(
"TableName");
849 unsigned int col2 = cfgView->findCol(
"Version");
858 for(
auto& aliasPair : originalTableAliasMap)
861 newTableVersionMap.find(std::pair<std::string, TableVersion>(
862 aliasPair.second.first, aliasPair.second.second));
864 if(tableIt == newTableVersionMap.end())
867 <<
"Error! Could not find the new entry for the original table "
868 << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
872 row = cfgView->addRow(
"import_aliases",
true );
873 cfgView->setValue(aliasPair.first, row, col0);
874 cfgView->setValue(aliasPair.second.first, row, col1);
875 cfgView->setValue(tableIt->second.toString(), row, col2);
884 config = cfgMgr->getTableByName(groupAliasesTableName);
885 cfgView = config->getViewP();
887 TableVersion::getNextVersion(theInterface_->findLatestVersion(config));
888 __COUTV__(newVersion);
889 cfgView->setVersion(newVersion);
890 theInterface_->saveActiveVersion(config);
892 memberMap[groupAliasesTableName] = newVersion;
895 __COUT__ <<
"\t to...\t" << groupAliasesTableName <<
":v"
896 << memberMap[groupAliasesTableName] << std::endl;
898 __COUT__ << versionAliasesTableName <<
":v" << memberMap[versionAliasesTableName]
901 config = cfgMgr->getTableByName(versionAliasesTableName);
902 cfgView = config->getViewP();
904 TableVersion::getNextVersion(theInterface_->findLatestVersion(config));
905 __COUTV__(newVersion);
906 cfgView->setVersion(newVersion);
907 theInterface_->saveActiveVersion(config);
909 memberMap[versionAliasesTableName] =
912 __COUT__ <<
"\t to...\t" << versionAliasesTableName <<
":v"
913 << memberMap[versionAliasesTableName] << std::endl;
915 __COUT__ <<
"Backbone member map completed" << __E__;
916 __COUTV__(StringMacros::mapToString(memberMap));
918 newKey = TableGroupKey::getNextKey(
919 theInterface_->findLatestGroupKey(activeBackboneGroupName));
924 theInterface_->saveTableGroup(
926 TableGroupKey::getFullGroupString(activeBackboneGroupName, newKey));
928 std::string renameFile =
929 ConfigurationManager::ACTIVE_GROUPS_FILENAME +
"." + nowTime;
930 rename(ConfigurationManager::ACTIVE_GROUPS_FILENAME.c_str(), renameFile.c_str());
932 __COUT__ <<
"Backing up '" << ConfigurationManager::ACTIVE_GROUPS_FILENAME
933 <<
"' to ... '" << renameFile <<
"'" << std::endl;
935 cfgMgr->activateTableGroup(activeBackboneGroupName,
939 catch(
const std::runtime_error& e)
941 __COUT_ERR__ <<
"There was a fatal error during backbone modification: "
942 << e.what() << __E__;
949 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups:" << std::endl;
950 for(
const auto& group : groupSet)
951 __COUT__ <<
"\t" << group.first.first <<
": " << group.first.second <<
" => "
952 << group.second << std::endl;
953 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups end." << std::endl;
957 __COUT__ <<
"End of Importing Active Table Groups!\n\n\n" << std::endl;
959 __COUT__ <<
"****************************" << std::endl;
960 __COUT__ <<
"There were " << groupSet.size() <<
" groups considered, and there were "
961 << groupErrors.size() <<
" errors found handling those groups." << std::endl;
962 __COUT__ <<
"The following errors were found handling the groups:" << std::endl;
963 for(
auto& groupErr : groupErrors)
964 __COUT__ <<
"\t" << groupErr.first.first <<
" " << groupErr.first.second <<
": \t"
965 << groupErr.second << std::endl;
966 __COUT__ <<
"End of errors.\n\n" << std::endl;
968 __COUT__ <<
"Run the following to return to your previous database structure:"
970 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n"
976 int main(
int argc,
char* argv[])
978 ImportSystemAliasTableGroups(argc, argv);