From 2aca9a620bebdde0df4184b35c7a9ae097643fc0 Mon Sep 17 00:00:00 2001 From: James McLaughlin Date: Fri, 13 Dec 2024 17:43:45 +0000 Subject: [PATCH] add wait_for_compact to rocksdb --- dataload/07_create_db/rocksdb/grebi_make_rocks/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dataload/07_create_db/rocksdb/grebi_make_rocks/src/main.rs b/dataload/07_create_db/rocksdb/grebi_make_rocks/src/main.rs index e59023a..3188afc 100644 --- a/dataload/07_create_db/rocksdb/grebi_make_rocks/src/main.rs +++ b/dataload/07_create_db/rocksdb/grebi_make_rocks/src/main.rs @@ -1,6 +1,7 @@ use grebi_shared::get_id; use grebi_shared::json_lexer::JsonToken; +use rocksdb::WaitForCompactOptions; use std::collections::HashMap; use std::collections::HashSet; use std::fs::File; @@ -74,5 +75,6 @@ fn main() { let start_time2 = std::time::Instant::now(); db.compact_range(None::<&[u8]>, None::<&[u8]>); + db.wait_for_compact(&WaitForCompactOptions::default()).unwrap(); eprintln!("Compacting took {} seconds", start_time2.elapsed().as_secs()); }