6 #include "otsdaq-core/ConfigurationInterface/ConfigurationInterface.h"
7 #include "otsdaq-core/ConfigurationInterface/ConfigurationManagerRW.h"
19 void FlattenActiveSystemAliasTableGroups(
int argc,
char* argv[])
21 std::cout <<
"=================================================\n";
22 std::cout <<
"=================================================\n";
23 std::cout <<
"=================================================\n";
24 __COUT__ <<
"\nFlattening Active System Aliases!" << std::endl;
26 std::cout <<
"\n\nusage: Two arguments:\n\t <baseFlatVersion> <pathToSwapIn "
28 <<
"\t Default values: baseFlatVersion = 0, pathToSwapIn = \"\" \n\n"
31 std::cout <<
"\n\nNote: you can optionally just swap databases (and not modify their "
33 <<
" by providing an invalid baseFlatVersion of -1.\n\n"
36 std::cout <<
"\n\nNote: This assumes artdaq db file type interface. "
37 <<
"The current database/ will be moved to database_<linuxtime>/ "
38 <<
"and if a pathToSwapIn is specified it will be copied to database/ "
39 <<
"before saving the currently active groups.\n\n"
42 std::cout <<
"argc = " << argc << std::endl;
43 for(
int i = 0; i < argc; i++)
44 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
48 std::cout <<
"Error! Must provide at least one parameter.\n\n" << std::endl;
53 std::string flatVersionStr = argv[1];
54 if(flatVersionStr.find(
'h') != std::string::npos)
57 <<
"Recognized parameter 1. as a 'help' option. Usage was printed. Exiting."
63 std::string pathToSwapIn =
"";
65 sscanf(argv[1],
"%d", &flatVersion);
67 pathToSwapIn = argv[2];
69 __COUT__ <<
"flatVersion = " << flatVersion << std::endl;
70 __COUT__ <<
"pathToSwapIn = " << pathToSwapIn << std::endl;
79 setenv(
"CONFIGURATION_TYPE",
"File", 1);
80 setenv(
"CONFIGURATION_DATA_PATH",
81 (std::string(getenv(
"USER_DATA")) +
"/ConfigurationDataExamples").c_str(),
84 "TABLE_INFO_PATH", (std::string(getenv(
"USER_DATA")) +
"/TableInfo").c_str(), 1);
88 setenv(
"SERVICE_DATA_PATH",
89 (std::string(getenv(
"USER_DATA")) +
"/ServiceData").c_str(),
94 setenv(
"OTSDAQ_LIB", (std::string(getenv(
"USER_DATA")) +
"/").c_str(), 1);
95 setenv(
"OTSDAQ_UTILITIES_LIB", (std::string(getenv(
"USER_DATA")) +
"/").c_str(), 1);
98 setenv(
"OTS_MAIN_PORT",
"2015", 1);
101 setenv(
"XDAQ_CONFIGURATION_DATA_PATH",
102 (std::string(getenv(
"USER_DATA")) +
"/XDAQConfigurations").c_str(),
104 setenv(
"XDAQ_CONFIGURATION_XML",
"otsConfigurationNoRU_CMake", 1);
111 std::cout <<
"\n\n\n" << __COUT_HDR_FL__ <<
"Loading active Aliases..." << std::endl;
139 std::map<std::pair<std::string, TableGroupKey>,
TableGroupKey> groupSet;
141 std::map<std::pair<std::string, TableVersion>,
TableVersion> modifiedTables;
142 std::map<std::string, std::pair<TableGroupKey, TableGroupKey>> activeGroupKeys;
143 std::map<std::pair<std::string, TableGroupKey>, std::string> groupErrors;
145 std::string activeBackboneGroupName =
"";
146 std::string activeContextGroupName =
"";
147 std::string activeIterateGroupName =
"";
148 std::string activeConfigGroupName =
"";
150 std::string nowTime = std::to_string(time(0));
152 std::string thenTime =
"";
153 if(pathToSwapIn !=
"")
155 thenTime = pathToSwapIn.substr(pathToSwapIn.rfind(
'_') + 1);
156 std::cout << __COUT_HDR_FL__ <<
"thenTime = " << thenTime << std::endl;
161 std::map<std::string, std::pair<std::string, TableGroupKey>> activeGroupsMap =
162 cfgMgr->getActiveTableGroups();
164 for(
const auto& activeGroup : activeGroupsMap)
166 groupSet.insert(std::pair<std::pair<std::string, TableGroupKey>,
TableGroupKey>(
167 std::pair<std::string, TableGroupKey>(activeGroup.second.first,
168 activeGroup.second.second),
170 activeGroupKeys.insert(
171 std::pair<std::string, std::pair<TableGroupKey, TableGroupKey>>(
172 activeGroup.second.first,
173 std::pair<TableGroupKey, TableGroupKey>(activeGroup.second.second,
176 if(activeGroup.first == ConfigurationManager::ACTIVE_GROUP_NAME_BACKBONE)
178 activeBackboneGroupName = activeGroup.second.first;
179 std::cout << __COUT_HDR_FL__
180 <<
"found activeBackboneGroupName = " << activeBackboneGroupName
183 else if(activeGroup.first == ConfigurationManager::ACTIVE_GROUP_NAME_CONTEXT)
185 activeContextGroupName = activeGroup.second.first;
186 std::cout << __COUT_HDR_FL__
187 <<
"found activeContextGroupName = " << activeContextGroupName
190 else if(activeGroup.first == ConfigurationManager::ACTIVE_GROUP_NAME_ITERATE)
192 activeIterateGroupName = activeGroup.second.first;
193 std::cout << __COUT_HDR_FL__
194 <<
"found activeIterateGroupName = " << activeIterateGroupName
197 else if(activeGroup.first ==
198 ConfigurationManager::ACTIVE_GROUP_NAME_CONFIGURATION)
200 activeConfigGroupName = activeGroup.second.first;
201 std::cout << __COUT_HDR_FL__
202 <<
"found activeConfigGroupName = " << activeConfigGroupName
208 const std::string groupAliasesTableName =
209 ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
210 std::map<std::string, TableVersion> activeVersions = cfgMgr->getActiveVersions();
211 if(activeVersions.find(groupAliasesTableName) == activeVersions.end())
213 __SS__ <<
"\nActive version of " << groupAliasesTableName <<
" missing! "
214 << groupAliasesTableName
215 <<
" is a required member of the Backbone configuration group."
216 <<
"\n\nLikely you need to activate a valid Backbone group." << std::endl;
220 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
221 cfgMgr->getNode(groupAliasesTableName).getChildren();
222 for(
auto& groupPair : aliasNodePairs)
223 groupSet.insert(std::pair<std::pair<std::string, TableGroupKey>,
TableGroupKey>(
224 std::pair<std::string, TableGroupKey>(
225 groupPair.second.getNode(
"GroupName").getValueAsString(),
226 TableGroupKey(groupPair.second.getNode(
"GroupKey").getValueAsString())),
229 std::cout << __COUT_HDR_FL__ <<
"Identified groups:" << std::endl;
230 for(
auto& group : groupSet)
231 std::cout << __COUT_HDR_FL__ << group.first.first <<
" " << group.first.second
233 std::cout << __COUT_HDR_FL__ << std::endl;
234 std::cout << __COUT_HDR_FL__ << std::endl;
239 std::string currentDir = getenv(
"ARTDAQ_DATABASE_URI");
241 if(currentDir.find(
"filesystemdb://") != 0)
243 __SS__ <<
"filesystemdb:// was not found in $ARTDAQ_DATABASE_URI!" << std::endl;
244 __COUT_ERR__ <<
"\n" << ss.str();
248 currentDir = currentDir.substr(std::string(
"filesystemdb://").length());
249 while(currentDir.length() &&
250 currentDir[currentDir.length() - 1] ==
'/')
251 currentDir = currentDir.substr(0, currentDir.length() - 1);
252 std::string moveToDir = currentDir +
"_" + nowTime;
255 __SS__ << (
"Aborting move! Must at least give version argument to flatten to!")
257 __COUT_ERR__ <<
"\n" << ss.str();
261 if(pathToSwapIn !=
"")
264 if((dp = opendir(pathToSwapIn.c_str())) == 0)
266 std::cout << __COUT_HDR_FL__ <<
"ERROR:(" << errno
267 <<
"). Can't open directory: " << pathToSwapIn << std::endl;
274 __COUT__ <<
"Moving current directory: \t" << currentDir << std::endl;
275 __COUT__ <<
"\t... to: \t\t" << moveToDir << std::endl;
277 rename(currentDir.c_str(), moveToDir.c_str());
279 if(pathToSwapIn !=
"")
281 __COUT__ <<
"Swapping in directory: \t" << pathToSwapIn << std::endl;
282 __COUT__ <<
"\t.. to: \t\t" << currentDir << std::endl;
283 rename(pathToSwapIn.c_str(), currentDir.c_str());
287 std::string activeGroupsFile =
288 ConfigurationManager::ACTIVE_GROUPS_FILENAME +
"." + thenTime;
289 FILE* fp = fopen(activeGroupsFile.c_str(),
"r");
292 __COUT__ <<
"Swapping active groups file: \t" << activeGroupsFile
294 __COUT__ <<
"\t.. to: \t\t" << ConfigurationManager::ACTIVE_GROUPS_FILENAME
296 rename(activeGroupsFile.c_str(),
297 ConfigurationManager::ACTIVE_GROUPS_FILENAME.c_str());
307 std::string accumulateErrors =
"";
311 std::map<std::string , std::string > groupAliases;
312 std::string groupComment;
313 std::string groupAuthor;
314 std::string groupCreateTime;
315 time_t groupCreateTime_t;
316 TableBase* groupMetadataTable = cfgMgr->getMetadataTable();
322 __COUT__ <<
"\n\nflatVersion " <<
TableVersion(flatVersion)
323 <<
" is an invalid or temporary version. Skipping to end!" << std::endl;
327 for(
auto& groupPair : groupSet)
331 __COUT__ <<
"****************************" << std::endl;
332 __COUT__ <<
"Loading members for " << groupPair.first.first <<
"("
333 << groupPair.first.second <<
")" << std::endl;
334 __COUT__ <<
"flatVersion = " << flatVersion << std::endl;
337 if(pathToSwapIn !=
"")
339 __COUT__ <<
"REVERT by Swapping back directory: \t" << currentDir
341 __COUT__ <<
"\t.. to: \t\t" << pathToSwapIn << std::endl;
342 if(rename(currentDir.c_str(), pathToSwapIn.c_str()) < 0)
344 __SS__ <<
"Problem!" << std::endl;
350 __COUT__ <<
"REVERT by Moving directory: \t" << currentDir << std::endl;
351 __COUT__ <<
"\t.. to temporary directory: \t\t" << (moveToDir +
"_tmp")
353 if(rename(currentDir.c_str(), (moveToDir +
"_tmp").c_str()) < 0)
355 __SS__ <<
"Problem!" << std::endl;
360 __COUT__ <<
"REVERT by Moving directory: \t" << moveToDir << std::endl;
361 __COUT__ <<
"\t... to: \t\t" << currentDir << std::endl;
362 if(rename(moveToDir.c_str(), currentDir.c_str()) < 0)
364 __SS__ <<
"Problem!" << std::endl;
372 cfgMgr->loadTableGroup(groupPair.first.first,
373 groupPair.first.second,
385 catch(std::runtime_error& e)
387 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
388 <<
"(" << groupPair.first.second <<
")" << std::endl;
389 __COUT__ << e.what() << std::endl;
394 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
395 <<
"(" << groupPair.first.second <<
")" << std::endl;
404 __COUT__ <<
"Moving current directory: \t" << currentDir << std::endl;
405 __COUT__ <<
"\t... to: \t\t" << moveToDir << std::endl;
406 if(rename(currentDir.c_str(), moveToDir.c_str()) < 0)
408 __SS__ <<
"Problem!" << std::endl;
412 if(pathToSwapIn !=
"")
414 __COUT__ <<
"Swapping in directory: \t" << pathToSwapIn << std::endl;
415 __COUT__ <<
"\t.. to: \t\t" << currentDir << std::endl;
416 if(rename(pathToSwapIn.c_str(), currentDir.c_str()) < 0)
418 __SS__ <<
"Problem!" << std::endl;
424 __COUT__ <<
"Moving temporary directory: \t" << (moveToDir +
"_tmp")
426 __COUT__ <<
"\t.. to current directory: \t\t" << currentDir << std::endl;
427 if(rename((moveToDir +
"_tmp").c_str(), currentDir.c_str()) < 0)
429 __SS__ <<
"Problem!" << std::endl;
443 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
444 std::pair<std::string, TableGroupKey>(groupPair.first.first,
445 groupPair.first.second),
446 "Error caught loading the group."));
455 for(
auto& memberPair : memberMap)
457 __COUT__ << memberPair.first <<
":v" << memberPair.second << std::endl;
461 if(modifiedTables.find(std::pair<std::string, TableVersion>(
462 memberPair.first, memberPair.second)) != modifiedTables.end())
464 __COUT__ <<
"Table was already modified!" << std::endl;
466 modifiedTables[std::pair<std::string, TableVersion>(
467 memberPair.first, memberPair.second)];
468 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v"
469 << memberPair.second << std::endl;
474 config = cfgMgr->getTableByName(memberPair.first);
475 cfgView = config->getViewP();
477 theInterface_->saveActiveVersion(config);
481 cfgView->setVersion(memberPair.second);
484 modifiedTables.insert(
485 std::pair<std::pair<std::string, TableVersion>,
TableVersion>(
486 std::pair<std::string, TableVersion>(memberPair.first,
490 memberPair.second = flatVersion;
492 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v" << memberPair.second
499 __COUTV__(StringMacros::mapToString(groupAliases));
500 __COUTV__(groupComment);
501 __COUTV__(groupAuthor);
502 __COUTV__(groupCreateTime);
503 sscanf(groupCreateTime.c_str(),
"%ld", &groupCreateTime_t);
504 __COUTV__(groupCreateTime_t);
508 while(groupMetadataTable->getViewP()->getNumberOfRows() > 1)
509 groupMetadataTable->getViewP()->deleteRow(0);
510 if(groupMetadataTable->getViewP()->getNumberOfRows() == 0)
511 groupMetadataTable->getViewP()->addRow();
515 groupMetadataTable->getViewP()->setValue(
516 StringMacros::mapToString(
517 groupAliases,
"," ,
":" ),
519 ConfigurationManager::METADATA_COL_ALIASES);
520 groupMetadataTable->getViewP()->setValue(
521 groupComment, 0, ConfigurationManager::METADATA_COL_COMMENT);
522 groupMetadataTable->getViewP()->setValue(
523 groupAuthor, 0, ConfigurationManager::METADATA_COL_AUTHOR);
524 groupMetadataTable->getViewP()->setValue(
525 groupCreateTime_t, 0, ConfigurationManager::METADATA_COL_TIMESTAMP);
528 groupMetadataTable->getViewP()->setVersion(
TableVersion(flatVersion));
529 theInterface_->saveActiveVersion(groupMetadataTable);
532 memberMap[groupMetadataTable->getTableName()] =
533 groupMetadataTable->getViewVersion();
537 theInterface_->saveTableGroup(
539 TableGroupKey::getFullGroupString(groupPair.first.first,
546 if(activeGroupKeys.find(groupPair.first.first) != activeGroupKeys.end() &&
547 activeGroupKeys[groupPair.first.first].first == groupPair.first.second)
548 activeGroupKeys[groupPair.first.first].second =
551 catch(std::runtime_error& e)
553 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
554 << groupPair.first.second <<
") " << std::endl;
555 __COUT__ << e.what() << std::endl;
558 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
559 std::pair<std::string, TableGroupKey>(groupPair.first.first,
560 groupPair.first.second),
561 "Error caught saving the group."));
565 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
566 << groupPair.first.second <<
") " << std::endl;
569 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
570 std::pair<std::string, TableGroupKey>(groupPair.first.first,
571 groupPair.first.second),
572 "Error caught saving the group."));
583 FILE* fp = fopen((moveToDir +
"/README_otsdaq_flatten.txt").c_str(),
"a");
585 __COUT__ <<
"\tError opening README file!" << std::endl;
593 timeinfo = localtime(&rawtime);
594 strftime(buffer, 200,
"%b %d, %Y %I:%M%p %Z", timeinfo);
597 "This database was moved from...\n\t %s \nto...\n\t %s \nat this "
598 "time \n\t %lu \t %s\n\n\n",
610 FILE* fp = fopen((currentDir +
"/README_otsdaq_flatten.txt").c_str(),
"a");
613 __COUT__ <<
"\tError opening README file!" << std::endl;
621 timeinfo = localtime(&rawtime);
622 strftime(buffer, 200,
"%b %d, %Y %I:%M:%S%p %Z", timeinfo);
625 "This database was moved from...\t %s \t to...\t %s at this time \t "
627 pathToSwapIn.c_str(),
661 if(activeBackboneGroupName ==
"")
663 __COUT__ <<
"No active Backbone table identified." << std::endl;
669 <<
"Modifying the active Backbone table to reflect new table versions and "
674 cfgMgr->loadTableGroup(activeBackboneGroupName,
675 activeGroupKeys[activeBackboneGroupName].second,
684 const std::string groupAliasesName =
685 ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
686 const std::string versionAliasesName =
687 ConfigurationManager::VERSION_ALIASES_TABLE_NAME;
689 std::map<std::string, TableVersion> activeMap = cfgMgr->getActiveVersions();
692 if(activeMap.find(groupAliasesName) != activeMap.end())
694 __COUT__ <<
"\n\nModifying " << groupAliasesName << std::endl;
695 config = cfgMgr->getTableByName(groupAliasesName);
696 cfgView = config->getViewP();
698 unsigned int col1 = cfgView->findCol(
"GroupName");
699 unsigned int col2 = cfgView->findCol(
"GroupKey");
706 for(
unsigned int row = 0; row < cfgView->getNumberOfRows(); ++row)
709 for(
const auto& group : groupSet)
710 if(group.second.isInvalid())
712 else if(cfgView->getDataView()[row][col1] == group.first.first &&
713 cfgView->getDataView()[row][col2] ==
714 group.first.second.toString())
717 __COUT__ <<
"Changing row " << row <<
" for "
718 << cfgView->getDataView()[row][col1]
719 <<
" key=" << cfgView->getDataView()[row][col2]
720 <<
" to NEW key=" << group.second << std::endl;
721 cfgView->setValue(group.second.toString(), row, col2);
727 cfgView->deleteRow(row--);
733 if(activeMap.find(versionAliasesName) != activeMap.end())
735 __COUT__ <<
"\n\nModifying " << versionAliasesName << std::endl;
736 config = cfgMgr->getTableByName(versionAliasesName);
737 cfgView = config->getViewP();
738 unsigned int col1 = cfgView->findCol(
"TableName");
739 unsigned int col2 = cfgView->findCol(
"Version");
743 for(
unsigned int row = 0; row < cfgView->getNumberOfRows(); ++row)
746 for(
const auto& table : modifiedTables)
747 if(cfgView->getDataView()[row][col1] == table.first.first &&
748 cfgView->getDataView()[row][col2] == table.first.second.toString())
751 __COUT__ <<
"Changing row " << row <<
" for "
752 << cfgView->getDataView()[row][col1]
753 <<
" version=" << cfgView->getDataView()[row][col2]
754 <<
" to NEW version=" << table.second << std::endl;
755 cfgView->setValue(table.second.toString(), row, col2);
761 cfgView->deleteRow(row--);
767 __COUT__ << groupAliasesName <<
":v" << memberMap[groupAliasesName] << std::endl;
769 config = cfgMgr->getTableByName(groupAliasesName);
770 cfgView = config->getViewP();
772 theInterface_->saveActiveVersion(config);
774 memberMap[groupAliasesName] = flatVersion;
776 __COUT__ <<
"\t to...\t" << groupAliasesName <<
":v"
777 << memberMap[groupAliasesName] << std::endl;
779 __COUT__ << versionAliasesName <<
":v" << memberMap[versionAliasesName]
782 config = cfgMgr->getTableByName(versionAliasesName);
783 cfgView = config->getViewP();
785 theInterface_->saveActiveVersion(config);
787 memberMap[versionAliasesName] = flatVersion;
789 __COUT__ <<
"\t to...\t" << versionAliasesName <<
":v"
790 << memberMap[versionAliasesName] << std::endl;
793 theInterface_->saveTableGroup(
795 TableGroupKey::getFullGroupString(activeBackboneGroupName,
798 activeGroupKeys[activeBackboneGroupName].second =
TableGroupKey(flatVersion);
800 __COUT__ <<
"New to-be-active backbone group " << activeBackboneGroupName <<
":v"
801 << activeGroupKeys[activeBackboneGroupName].second << std::endl;
810 << __COUT_HDR_FL__ <<
"Manipulating the Active Groups file..."
814 FILE* fp = fopen(ConfigurationManager::ACTIVE_GROUPS_FILENAME.c_str(),
"r");
817 __SS__ <<
"Original active groups file '"
818 << ConfigurationManager::ACTIVE_GROUPS_FILENAME <<
"' not found."
823 __COUT__ <<
"Backing up file: " << ConfigurationManager::ACTIVE_GROUPS_FILENAME
828 std::string renameFile =
829 ConfigurationManager::ACTIVE_GROUPS_FILENAME +
"." + nowTime;
830 rename(ConfigurationManager::ACTIVE_GROUPS_FILENAME.c_str(), renameFile.c_str());
832 __COUT__ <<
"Backup file name: " << renameFile << std::endl;
834 TableGroupKey *theConfigurationTableGroupKey_, *theContextTableGroupKey_,
835 *theBackboneTableGroupKey_, *theIterateTableGroupKey_;
836 std::string theConfigurationTableGroup_, theContextTableGroup_,
837 theBackboneTableGroup_, theIterateTableGroup_;
839 theConfigurationTableGroup_ = activeConfigGroupName;
840 theConfigurationTableGroupKey_ = &(activeGroupKeys[activeConfigGroupName].second);
842 theContextTableGroup_ = activeContextGroupName;
843 theContextTableGroupKey_ = &(activeGroupKeys[activeContextGroupName].second);
845 theBackboneTableGroup_ = activeBackboneGroupName;
846 theBackboneTableGroupKey_ = &(activeGroupKeys[activeBackboneGroupName].second);
848 theIterateTableGroup_ = activeIterateGroupName;
849 theIterateTableGroupKey_ = &(activeGroupKeys[activeIterateGroupName].second);
853 __COUT__ <<
"Updating persistent active groups to "
854 << ConfigurationManager::ACTIVE_GROUPS_FILENAME <<
" ..."
857 std::string fn = ConfigurationManager::ACTIVE_GROUPS_FILENAME;
858 FILE* fp = fopen(fn.c_str(),
"w");
862 fprintf(fp,
"%s\n", theContextTableGroup_.c_str());
865 theContextTableGroupKey_
866 ? theContextTableGroupKey_->toString().c_str()
868 fprintf(fp,
"%s\n", theBackboneTableGroup_.c_str());
871 theBackboneTableGroupKey_
872 ? theBackboneTableGroupKey_->toString().c_str()
874 fprintf(fp,
"%s\n", theConfigurationTableGroup_.c_str());
877 theConfigurationTableGroupKey_
878 ? theConfigurationTableGroupKey_->toString().c_str()
880 fprintf(fp,
"%s\n", theIterateTableGroup_.c_str());
883 theIterateTableGroupKey_
884 ? theIterateTableGroupKey_->toString().c_str()
892 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups:" << std::endl;
893 for(
const auto& group : groupSet)
894 __COUT__ <<
"\t" << group.first.first <<
": " << group.first.second <<
" => "
895 << group.second << std::endl;
896 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups end." << std::endl;
900 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Active Groups:" << std::endl;
901 for(
const auto& activeGroup : activeGroupKeys)
902 __COUT__ <<
"\t" << activeGroup.first <<
": " << activeGroup.second.first
903 <<
" => " << activeGroup.second.second << std::endl;
905 __COUT__ << activeBackboneGroupName <<
" is the "
906 << ConfigurationManager::ACTIVE_GROUP_NAME_BACKBONE <<
"." << std::endl;
907 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Active Groups end." << std::endl;
912 << __COUT_HDR_FL__ <<
"End of Flattening Active Table Groups!\n\n\n"
915 __COUT__ <<
"****************************" << std::endl;
916 __COUT__ <<
"There were " << groupSet.size() <<
" groups considered, and there were "
917 << groupErrors.size() <<
" errors found handling those groups." << std::endl;
918 __COUT__ <<
"The following errors were found handling the groups:" << std::endl;
919 for(
auto& groupErr : groupErrors)
920 __COUT__ <<
"\t" << groupErr.first.first <<
" " << groupErr.first.second <<
": \t"
921 << groupErr.second << std::endl;
922 __COUT__ <<
"End of errors.\n\n" << std::endl;
924 __COUT__ <<
"Run the following to return to your previous database structure:"
926 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << moveToDir <<
"\n\n"
932 int main(
int argc,
char* argv[])
934 FlattenActiveSystemAliasTableGroups(argc, argv);