Commit 22dcd000 authored by Giorgio Azzinnaro's avatar Giorgio Azzinnaro

namespace

parent 9de5bd29
......@@ -70,10 +70,10 @@ Loader::Loader(
{
// profanedb.protobuf.options.key is defined in here
// It is used to mark the primary key on Messages
const FileDescriptor * optionsFile = schemaPool.FindFileByName("profanedb/protobuf/options.proto");
FileDescriptorProto optionsProto;
optionsFile->CopyTo(&optionsProto);
normalizedDescriptorDb.AddAndOwn(&optionsProto);
// const FileDescriptor * optionsFile = schemaPool.FindFileByName("profanedb/protobuf/options.proto");
// FileDescriptorProto optionsProto;
// optionsFile->CopyTo(&optionsProto);
// normalizedDescriptorDb.AddAndOwn(&optionsProto);
BOOST_LOG_TRIVIAL(debug) << "Loading profanedb/protobuf/options.proto and copying to normalized descriptor db";
......@@ -97,6 +97,7 @@ Loader::Loader(
BOOST_LOG_TRIVIAL(debug) << "Adding normalized proto " << normalizedProto.name();
// The normalizedDescriptorDb keeps these new Descriptors
normalizedDescriptorDb.AddAndOwn(&normalizedProto);
normalizedPool.FindFileByName(normalizedProto.name());
}
}
......
......@@ -19,21 +19,28 @@
#include "storage.h"
profanedb::vault::rocksdb::Storage::Storage(std::unique_ptr<DB> rocksDb)
using profanedb::protobuf::StorableMessage;
using profanedb::protobuf::Key;
namespace profanedb {
namespace vault {
namespace rocksdb {
Storage::Storage(std::unique_ptr<DB> rocksDb)
: rocksDb(std::move(rocksDb))
{
}
void profanedb::vault::rocksdb::Storage::Store(const profanedb::protobuf::StorableMessage & storable)
void Storage::Store(const StorableMessage & storable)
{
this->rocksDb->Put(::rocksdb::WriteOptions(),
storable.key().SerializeAsString(),
storable.payload());
}
profanedb::protobuf::StorableMessage profanedb::vault::rocksdb::Storage::Retrieve(const profanedb::protobuf::Key & key) const
StorableMessage Storage::Retrieve(const Key & key) const
{
protobuf::StorableMessage stored;
StorableMessage stored;
*stored.mutable_key() = key;
......@@ -43,3 +50,7 @@ profanedb::protobuf::StorableMessage profanedb::vault::rocksdb::Storage::Retriev
return stored;
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment