Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Nov 13, 2023
1 parent 6f54415 commit 8dc5f38
Show file tree
Hide file tree
Showing 9 changed files with 402 additions and 449 deletions.
9 changes: 6 additions & 3 deletions src/bin/toydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ async fn main() -> Result<()> {
simplelog::SimpleLogger::init(loglevel, logconfig.build())?;

let path = std::path::Path::new(&cfg.data_dir);
let raft_store: Box<dyn storage::log::Store> = match cfg.storage_raft.as_str() {
"hybrid" | "" => Box::new(storage::log::Hybrid::new(path, cfg.sync)?),
"memory" => Box::new(storage::log::Memory::new()),
let raft_store: Box<dyn storage::engine::Dyn> = match cfg.storage_raft.as_str() {
"bitcask" | "" => Box::new(storage::engine::BitCask::new_compact(
path.join("log"),
cfg.compact_threshold,
)?),
"memory" => Box::new(storage::engine::Memory::new()),
name => return Err(Error::Config(format!("Unknown Raft storage engine {}", name))),
};
let raft_state: Box<dyn raft::State> = match cfg.storage_sql.as_str() {
Expand Down
Loading

0 comments on commit 8dc5f38

Please sign in to comment.