Skip to content
Snippets Groups Projects
Commit 836d52bd authored by Robin Müller's avatar Robin Müller
Browse files

Merged with master and fixed VisionMemory issue

- Skipped saving Vision Memory documents larger than 16MB in MongoDB due to size limit
- Commented out some messages and currently unused code
parent 386b30ad
No related branches found
No related tags found
1 merge request!464Draft: Feature/mongo db
Pipeline #21048 failed
......@@ -224,8 +224,8 @@ namespace armarx::armem::server::ltm
}
else
{
ARMARX_INFO << "CoreSegment does not have aron type, so aron type information "
"cannot be exported";
//ARMARX_INFO << "CoreSegment does not have aron type, so aron type information "
// "cannot be exported";
writeForeignKeyToPreviousDocument();
}
......
......@@ -131,6 +131,7 @@ namespace armarx::armem::server::ltm
}
}*/
/*
// check for special members TODO: only allowed for direct children?
auto allFilesInIndexFolder = getAllFiles();
for (const auto& [key, m] : datadict->getElements())
......@@ -157,7 +158,7 @@ namespace armarx::armem::server::ltm
}
}
}
}
}*/
from_aron(metadatadict, datadict, e);
}
......@@ -208,7 +209,7 @@ namespace armarx::armem::server::ltm
//ARMARX_INFO << "save and extract is " << saveAndExtract;
/*
// check special members for special converters
for (auto& c : processors->converters)
{
......@@ -224,10 +225,11 @@ namespace armarx::armem::server::ltm
std::string filename = (memberName + memberDataModeSuffix + c->suffix);
ensureFileExists(filename, true);
writeDataToFile(filename, memberDataVec);
//ensureFileExists(filename, true);
//writeDataToFile(filename, memberDataVec);
}
}
*/
// convert dict and metadata
auto [dataVec, dataVecModeSuffix] = dictConverter.convert(dataAron);
......
......@@ -248,7 +248,7 @@ namespace armarx::armem::server::ltm
{
std::lock_guard l(ltm_mutex); // we cannot load a memory multiple times simultaneously
ARMARX_DEBUG << VAROUT(fullPathExists());
//ARMARX_DEBUG << VAROUT(fullPathExists());
if ((connected() && collectionExists()) /* || fullPathExists()*/)
{
......
......@@ -222,7 +222,7 @@ namespace armarx::armem::server::ltm
}
else
{
ARMARX_INFO << "ProviderSegment does not seem to have an aron type, so aron type information connot be exported";
//ARMARX_INFO << "ProviderSegment does not seem to have an aron type, so aron type information connot be exported";
writeForeignKeyToPreviousDocument();
}
......
......@@ -72,8 +72,15 @@ namespace armarx::armem::server::ltm::util::mongodb
{
std::string v = value.dump();
auto q = bsoncxx::from_json(v);
// Überprüfe die Größe des BSON-Dokuments
size_t document_size = q.view().length();
if (document_size > 16 * 1024 * 1024) { // 16 MB Grenze
ARMARX_INFO << deactivateSpam() << "Document size exceeds the 16MB limit: " << document_size << " bytes." ;
return false;
}
auto res = coll.insert_one(q.view());
return (bool)res;
}
......@@ -118,7 +125,7 @@ namespace armarx::armem::server::ltm::util::mongodb
//Workaround to create an empty Database client[databaseName] does not create a database if nothing is added
//db = client[databaseName];
//db.create_collection("empty");
ARMARX_INFO << "Create Database " << databaseName;
ARMARX_INFO << deactivateSpam() << "Create Database " << databaseName;
return client[databaseName];
}
return std::nullopt;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment