From 73d1de4366878a9f7ee744d8addb7e7b2d198f78 Mon Sep 17 00:00:00 2001 From: Liangliang Gu Date: Wed, 28 Aug 2019 19:37:11 +0800 Subject: [PATCH] [FLASH-455] Remove level db dependency (#206) --- .gitmodules | 3 -- contrib/CMakeLists.txt | 1 - contrib/leveldb | 1 - dbms/CMakeLists.txt | 1 - .../Storages/Transaction/tests/CMakeLists.txt | 3 -- .../Transaction/tests/leveldb_test.cpp | 32 ------------------- 6 files changed, 41 deletions(-) delete mode 160000 contrib/leveldb delete mode 100644 dbms/src/Storages/Transaction/tests/leveldb_test.cpp diff --git a/.gitmodules b/.gitmodules index 1276ff94bf1..7a038a93e66 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,9 +44,6 @@ [submodule "contrib/client-c"] path = contrib/client-c url = git@github.com:tikv/client-c.git -[submodule "contrib/leveldb"] - path = contrib/leveldb - url = https://github.com/google/leveldb.git [submodule "contrib/junction"] path = contrib/junction url = https://github.com/preshing/junction.git diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index bc87acffc43..13c2f861b5b 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory (kvproto/cpp) -add_subdirectory (leveldb) add_subdirectory (client-c) add_subdirectory (tipb/cpp) diff --git a/contrib/leveldb b/contrib/leveldb deleted file mode 160000 index 808e59ec6a1..00000000000 --- a/contrib/leveldb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 808e59ec6a160244960cda64b393968ffbdae72c diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index fe2d618596b..c0b89c3db59 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -155,7 +155,6 @@ target_link_libraries (dbms clickhouse_common_io flash_service kvproto - leveldb kv_client tipb ${Protobuf_LIBRARIES} diff --git a/dbms/src/Storages/Transaction/tests/CMakeLists.txt b/dbms/src/Storages/Transaction/tests/CMakeLists.txt index 22e5ce98326..fc5b7cb6d71 100644 --- a/dbms/src/Storages/Transaction/tests/CMakeLists.txt +++ b/dbms/src/Storages/Transaction/tests/CMakeLists.txt @@ -12,9 +12,6 @@ target_link_libraries (kvstore dbms) add_executable (region_test region.cpp) target_link_libraries (region_test dbms) -add_executable (leveldb_test leveldb_test.cpp) -target_link_libraries (leveldb_test dbms) - add_executable(type_mapping gtest_type_mapping.cpp) target_link_libraries(type_mapping dbms gtest_main) diff --git a/dbms/src/Storages/Transaction/tests/leveldb_test.cpp b/dbms/src/Storages/Transaction/tests/leveldb_test.cpp deleted file mode 100644 index d0be224832a..00000000000 --- a/dbms/src/Storages/Transaction/tests/leveldb_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include -#include - -int main() -{ - std::string path = "/tmp/testdb"; - SCOPE_EXIT({ Poco::File(path).remove(true); }); - - leveldb::DB * db; - leveldb::Options options; - options.create_if_missing = true; - leveldb::Status status = leveldb::DB::Open(options, path, &db); - assert(status.ok()); - std::cerr << status.ToString() << std::endl; - - std::string value; - leveldb::Status s = db->Put(leveldb::WriteOptions(), "key1", "value"); - if (s.ok()) - s = db->Get(leveldb::ReadOptions(), "key1", &value); - if (s.ok()) - s = db->Put(leveldb::WriteOptions(), "key2", value); - if (s.ok()) - s = db->Delete(leveldb::WriteOptions(), "key1"); - - std::cerr << status.ToString() << std::endl; - - delete db; - return 0; -} \ No newline at end of file