From 31a546f70bbff936c962c63b60bff44798a16736 Mon Sep 17 00:00:00 2001 From: gcxfd Date: Wed, 6 Jul 2022 10:28:35 +0800 Subject: [PATCH] remove create_if_not_exists; see https://github.com/tikv/agatedb/issues/176 Signed-off-by: gcxfd --- agate_bench/src/main.rs | 3 --- src/db/opt.rs | 14 +++----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/agate_bench/src/main.rs b/agate_bench/src/main.rs index 3d5576c8..9b2df624 100644 --- a/agate_bench/src/main.rs +++ b/agate_bench/src/main.rs @@ -136,7 +136,6 @@ fn main() { let chunk_size: u64 = sub_matches.value_of("chunk_size").unwrap().parse().unwrap(); let mut options = AgateOptions { - create_if_not_exists: true, dir: directory.clone(), value_dir: directory, managed_txns: true, @@ -209,7 +208,6 @@ fn main() { let times: u64 = sub_matches.value_of("times").unwrap().parse().unwrap(); let mut options = AgateOptions { - create_if_not_exists: true, sync_writes: true, dir: directory.clone(), value_dir: directory, @@ -287,7 +285,6 @@ fn main() { sub_matches.value_of("value_size").unwrap().parse().unwrap(); let mut options = AgateOptions { - create_if_not_exists: true, sync_writes: true, dir: directory.clone(), value_dir: directory, diff --git a/src/db/opt.rs b/src/db/opt.rs index edd3bef3..9dad48bb 100644 --- a/src/db/opt.rs +++ b/src/db/opt.rs @@ -129,12 +129,6 @@ pub struct AgateOptions { /// The default value of `managed_txns` is false. pub managed_txns: bool, - /// Create the directory if the provided open path doesn't exists. - /// - /// The default value of `create_if_not_exists` is false - #[getset(set = "pub")] - pub create_if_not_exists: bool, - /// Max entries in batch. /// /// The default value of `max_batch_count` is `max_batch_size` / `MAX_NODE_SIZE`. @@ -181,8 +175,6 @@ impl Default for AgateOptions { managed_txns: false, - create_if_not_exists: false, - max_batch_count: 0, max_batch_size: 0, } @@ -245,14 +237,14 @@ mod tests { #[test] fn test_options_set() { let mut opt = AgateOptions::default(); - opt.set_create_if_not_exists(true) - .set_in_memory(true) + + opt.set_in_memory(true) .set_value_log_file_size(256) .set_num_memtables(3) .set_value_log_max_entries(96) .set_sync_writes(true) .set_mem_table_size(1024); - assert!(opt.create_if_not_exists); + assert!(opt.in_memory); assert_eq!(opt.value_log_file_size, 256); assert_eq!(opt.num_memtables, 3);