5#include <SimoxUtility/json.h>
19 namespace bsoncxxbuilder = bsoncxx::builder::stream;
20 namespace bsoncxxdoc = bsoncxx::document;
23 Memory::checkConnection()
const
29 <<
"The connection to mongocxx for ltm '" << cache.name()
30 <<
"' is not valid. Settings are: " <<
dbsettings.toString()
31 <<
"\nTo start it, run e.g.: \n"
32 <<
"armarx memory start"
38 auto client = pool.acquire();
49 auto client = checkConnection();
55 std::lock_guard l(ltm_mutex);
56 auto databases =
client->list_databases();
58 ss <<
"Found Memory-Collection in MongoDB for '" + cache.name() +
"': \n";
59 for (
const auto& doc : databases)
61 auto el = doc[
"name"];
62 ss <<
"\t - " << el.get_utf8().value <<
"\n";
80 auto client = checkConnection();
86 std::lock_guard l(ltm_mutex);
99 auto client = checkConnection();
105 std::lock_guard l(ltm_mutex);
113 moveCacheToLUTAndClearCache();
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
static mongocxx::pool & Connect(const MongoDBSettings &settings)
static bool ConnectionIsValid(const MongoDBSettings &settings, bool forceNewConnection=false)
void encodeAndStore() override
ConnectionManager::MongoDBSettings dbsettings
void convert(armem::wm::Memory &) override
Client-side working memory.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define TIMING_START(name)
Helper macro to do timing tests.
#define TIMING_END_STREAM(name, os)
Prints duration.
This file is part of ArmarX.
void store(const mongocxx::database &db, const armem::wm::Memory &m)
void load(const mongocxx::database &db, armem::wm::Memory &m)
void convert(const mongocxx::database &db, armem::wm::Memory &m)
mongocxx::pool::entry PoolClientPtr