Changes have been pushed for the repository "fawkesrobotics/fawkes".
Clone: https://github.com/fawkesrobotics/fawkes.git Gitweb: https://github.com/fawkesrobotics/fawkes The branch, thofmann/rm-dump-restore-improvements has been updated discards b64dfac09fad405bf87365903a508a5247be0320 (commit) to 4178d7f28fa00b706eb2327550d3ce5b6af413eb (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (b64dfac09fad405bf87365903a508a5247be0320) \ N -- N -- N (4178d7f28fa00b706eb2327550d3ce5b6af413eb) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. https://github.com/fawkesrobotics/fawkes/tree/thofmann/rm-dump-restore-improvements Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - *Log* --------------------------------------------------------------- commit 4178d7f28fa00b706eb2327550d3ce5b6af413eb Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Tue Feb 11 09:47:06 2020 +0100 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Tue Feb 11 09:58:40 2020 +0100 robot-memory: read hostport from config in dump/restore collection Do not hardcode the host and port but instead read them from the config. This fixes #199. https://github.com/fawkesrobotics/fawkes/commit/4178d7f28 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *Summary* ----------------------------------------------------------- src/plugins/robot-memory/robot_memory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) - *Diffs* ------------------------------------------------------------- - *commit* 4178d7f28fa00b706eb2327550d3ce5b6af413eb - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Tue Feb 11 09:47:06 2020 +0100 Subject: robot-memory: read hostport from config in dump/restore collection src/plugins/robot-memory/robot_memory.cpp | 17 ++++++++++++++--- src/plugins/robot-memory/robot_memory.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) _Diff for modified files_: diff --git a/src/plugins/robot-memory/robot_memory.cpp b/src/plugins/robot-memory/robot_memory.cpp index 582609556..33db7d027 100644 --- a/src/plugins/robot-memory/robot_memory.cpp +++ b/src/plugins/robot-memory/robot_memory.cpp @@ -609,7 +609,7 @@ RobotMemory::restore_collection(const std::string &dbcollection, //call mongorestore from folder with initial restores std::string command = "/usr/bin/mongorestore --dir " + path + " -d " + target_db + " -c " - + target_collection + " --host=127.0.0.1 --port 27021"; + + target_collection + " --host=" + get_hostport(dbcollection); log_deb(std::string("Restore command: " + command), "warn"); FILE *bash_output = popen(command.c_str(), "r"); @@ -652,8 +652,9 @@ RobotMemory::dump_collection(const std::string &dbcollection, const std::string auto [db, collection] = split_db_collection_string(dbcollection); - std::string command = "/usr/bin/mongodump --out=" + path + " --db=" + db + " --collection=" - + collection + " --host=127.0.0.1 --forceTableScan --port 27021"; + std::string command = "/usr/bin/mongodump --out=" + path + " --db=" + db + + " --collection=" + collection + " --forceTableScan" + + " --host=" + get_hostport(dbcollection); log(std::string("Dump command: " + command), "info"); FILE *bash_output = popen(command.c_str(), "r"); //check if output is ok @@ -730,6 +731,16 @@ RobotMemory::is_distributed_database(const std::string &dbcollection) != distributed_dbs_.end(); } +std::string +RobotMemory::get_hostport(const std::string &dbcollection) +{ + if (distributed_ && is_distributed_database(dbcollection)) { + return config_->get_string("/plugins/mongodb/clients/robot-memory-distributed-direct/hostport"); + } else { + return config_->get_string("/plugins/mongodb/clients/robot-memory-local-direct/hostport"); + } +} + /** * Get the mongodb client associated with the collection (eighter the local or distributed one) * @param collection The collection name in the form "<dbname>.<collname>" diff --git a/src/plugins/robot-memory/robot_memory.h b/src/plugins/robot-memory/robot_memory.h index e6b28db33..09debe1c5 100644 --- a/src/plugins/robot-memory/robot_memory.h +++ b/src/plugins/robot-memory/robot_memory.h @@ -208,6 +208,7 @@ private: const std::string & level = "info"); bool is_distributed_database(const std::string &dbcollection); + std::string get_hostport(const std::string &dbcollection); mongocxx::client * get_mongodb_client(const std::string &collection); mongocxx::collection get_collection(const std::string &dbcollection); _______________________________________________ fawkes-commits mailing list fawkes-commits@lists.kbsg.rwth-aachen.de https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits