State copy optimization

This commit is contained in:
arkpar
2016-02-03 19:34:51 +01:00
parent d467ac76b0
commit b9af3f9260
9 changed files with 121 additions and 65 deletions

View File

@@ -8,7 +8,6 @@ use rocksdb::{DB, Writable};
#[cfg(test)]
use std::env;
#[derive(Clone)]
/// Implementation of the HashDB trait for a disk-backed database with a memory overlay
/// and latent-removal semantics.
///
@@ -53,8 +52,6 @@ impl JournalDB {
Self::new(DB::open_default(dir.to_str().unwrap()).unwrap())
}
/// Get a clone of the overlay db portion of this.
pub fn to_overlaydb(&self) -> OverlayDB { self.forward.clone() }
/// Commit all recent insert operations and historical removals from the old era
/// to the backing database.
@@ -119,10 +116,6 @@ impl JournalDB {
self.forward.commit()
}
/// Revert all operations on this object (i.e. `insert()`s and `removes()`s) since the
/// last `commit()`.
pub fn revert(&mut self) { self.forward.revert(); self.removes.clear(); }
}
impl HashDB for JournalDB {

View File

@@ -12,7 +12,6 @@ use std::env;
use std::collections::HashMap;
use rocksdb::{DB, Writable, IteratorMode};
#[derive(Clone)]
/// Implementation of the HashDB trait for a disk-backed database with a memory overlay.
///
/// The operations `insert()` and `remove()` take place on the memory overlay; batches of