Skip to content

Commit

Permalink
Update kv example
Browse files Browse the repository at this point in the history
  • Loading branch information
spacejam committed Aug 29, 2022
1 parent 2cf359c commit 9972c67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pagetable = { version = "0.2.6" }
fault-injection = "1.0.7"
rand = { version = "0.8.5", optional = true }
zstd-safe = { version="5.0.2", features=["std", "experimental"] }
serde = { version = "1.0.144", features = ["derive"], optional = true }
bincode = { version = "1.3.3", optional = true }

[[bench]]
name = "marble_bench"
Expand Down
4 changes: 2 additions & 2 deletions examples/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct Kv {

impl Kv {
fn recover(path: &str) -> io::Result<Kv> {
let heap = Marble::open(path)?;
let heap = marble::open(path)?;

let index: Index = if let Some(index_data) = heap.read(INDEX_OBJECT_ID)? {
deserialize(&index_data).unwrap()
Expand Down Expand Up @@ -121,7 +121,7 @@ impl Kv {

self.heap.write_batch(write_batch)?;

let stats = self.heap.file_statistics();
let stats = self.heap.file_stats();

if stats.dead_objects > stats.live_objects {
self.heap.maintenance()?;
Expand Down

0 comments on commit 9972c67

Please sign in to comment.