From b3de788556382c690af8c8db37294e9ea28c2b25 Mon Sep 17 00:00:00 2001 From: augurier <14434658+augurier@user.noreply.gitee.com> Date: Sun, 29 Dec 2024 09:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E5=87=BA=E4=BA=86=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95destroy=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- benchmarks/db_bench_FieldDB.cc | 5 ++--- benchmarks/db_bench_testDB.cc | 4 ++-- testdb/testdb.cc | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmarks/db_bench_FieldDB.cc b/benchmarks/db_bench_FieldDB.cc index dfb8f61..a07795a 100644 --- a/benchmarks/db_bench_FieldDB.cc +++ b/benchmarks/db_bench_FieldDB.cc @@ -547,7 +547,7 @@ class Benchmark { } } if (!FLAGS_use_existing_db) { - DestroyDB(FLAGS_db, Options()); + fielddb::DestroyDB(FLAGS_db, Options()); } } @@ -676,7 +676,7 @@ class Benchmark { } else { delete db_; db_ = nullptr; - DestroyDB(FLAGS_db, Options()); + fielddb::DestroyDB(FLAGS_db, Options()); Open(); } } @@ -833,7 +833,6 @@ class Benchmark { options.compression = FLAGS_compression ? kSnappyCompression : kNoCompression; // Status s = DB::Open(options, FLAGS_db, &db_); - //fielddb::DestroyDB(FLAGS_db, options); db_ = new FieldDB(); Status s = FieldDB::OpenFieldDB(options, FLAGS_db, &db_); if (!s.ok()) { diff --git a/benchmarks/db_bench_testDB.cc b/benchmarks/db_bench_testDB.cc index 6191132..5a4acb9 100644 --- a/benchmarks/db_bench_testDB.cc +++ b/benchmarks/db_bench_testDB.cc @@ -544,7 +544,7 @@ class Benchmark { } } if (!FLAGS_use_existing_db) { - DestroyDB(FLAGS_db, Options()); + testdb::DestroyDB(FLAGS_db, Options()); } } @@ -665,7 +665,7 @@ class Benchmark { } else { delete db_; db_ = nullptr; - DestroyDB(FLAGS_db, Options()); + testdb::DestroyDB(FLAGS_db, Options()); Open(); } } diff --git a/testdb/testdb.cc b/testdb/testdb.cc index 6baa209..d932f97 100644 --- a/testdb/testdb.cc +++ b/testdb/testdb.cc @@ -2,6 +2,7 @@ #include "db/db_impl.h" #include #include "leveldb/status.h" +#include "testdb.h" using namespace testdb; Status testDB::OpentestDB(Options& options, @@ -93,7 +94,7 @@ void testDB::CompactRange(const Slice *begin, const Slice *end) { kvDB_->CompactRange(begin, end); } -Status DestroyDB(const std::string& name, const Options& options) { +Status testdb::DestroyDB(const std::string& name, const Options& options) { Status s; s = leveldb::DestroyDB(name+"_kvDB", options); assert(s.ok()); @@ -108,4 +109,4 @@ testDB::~testDB() { delete kvDB_; // delete indexDB_; // delete metaDB_; -} \ No newline at end of file +}