1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-15 12:09:09 +03:00

Made the new IOC unlink test work. Hopefully, finally,

resolved the path & extension confusion.
This commit is contained in:
Patrick LeBlanc
2019-04-03 14:10:04 -05:00
parent 91c05d1000
commit e84a88b7a8
4 changed files with 122 additions and 11 deletions

View File

@@ -155,6 +155,39 @@ MetadataFile::MetadataFile(const char* filename, no_create_t)
}
}
MetadataFile::MetadataFile(const boost::filesystem::path &path)
{
mpConfig = MetadataConfig::get();
mpLogger = SMLogging::get();
mFilename = path.string();
if (boost::filesystem::exists(path))
{
_exists = true;
boost::property_tree::ptree jsontree;
boost::property_tree::read_json(mFilename, jsontree);
metadataObject newObject;
//try catch
mVersion = jsontree.get<int>("version");
mRevision = jsontree.get<int>("revision");
BOOST_FOREACH(const boost::property_tree::ptree::value_type &v, jsontree.get_child("objects"))
{
metadataObject newObject;
newObject.offset = v.second.get<uint64_t>("offset");
newObject.length = v.second.get<uint64_t>("length");
newObject.key = v.second.get<string>("key");
mObjects.insert(newObject);
}
}
else
{
mVersion = 1;
mRevision = 1;
_exists = false;
}
}
MetadataFile::~MetadataFile()
{
}