Compile utils/file.cpp in kvstore_lib
Reviewers: buda, dgleich Reviewed By: dgleich Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1384
This commit is contained in:
parent
43d5980ff3
commit
6234075983
@ -98,8 +98,9 @@ target_link_libraries(memgraph_lib ${MEMGRAPH_ALL_LIBS})
|
||||
add_dependencies(memgraph_lib generate_opencypher_parser)
|
||||
|
||||
# STATIC library used to store key-value pairs
|
||||
add_library(kvstore_lib STATIC storage/kvstore.cpp)
|
||||
target_link_libraries(kvstore_lib stdc++fs rocksdb bzip2 zlib)
|
||||
# TODO: Create a utils lib to link with, and remove utils/file.cpp.
|
||||
add_library(kvstore_lib STATIC storage/kvstore.cpp utils/file.cpp)
|
||||
target_link_libraries(kvstore_lib stdc++fs fmt glog rocksdb bzip2 zlib)
|
||||
|
||||
# Generate a version.hpp file
|
||||
set(VERSION_STRING ${memgraph_VERSION})
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "storage/kvstore.hpp"
|
||||
|
||||
#include "durability/paths.hpp"
|
||||
#include "utils/file.hpp"
|
||||
|
||||
namespace storage {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include <experimental/optional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <rocksdb/db.h>
|
||||
@ -11,8 +12,6 @@
|
||||
|
||||
namespace storage {
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
class KVStoreError : public utils::BasicException {
|
||||
public:
|
||||
using utils::BasicException::BasicException;
|
||||
@ -30,7 +29,7 @@ class KVStore final {
|
||||
* NOTE: Don't instantiate more instances of a KVStore with the same
|
||||
* storage directory because that will lead to undefined behaviour.
|
||||
*/
|
||||
explicit KVStore(fs::path storage);
|
||||
explicit KVStore(std::experimental::filesystem::path storage);
|
||||
|
||||
/**
|
||||
* Store value under the given key.
|
||||
@ -66,7 +65,7 @@ class KVStore final {
|
||||
bool Delete(const std::string &key);
|
||||
|
||||
private:
|
||||
fs::path storage_;
|
||||
std::experimental::filesystem::path storage_;
|
||||
std::unique_ptr<rocksdb::DB> db_;
|
||||
rocksdb::Options options_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user