Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Sep 27, 2024
1 parent b3f9acd commit a00de24
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 14 deletions.
140 changes: 138 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ memstore-example-harness = { path = "examples/memstore" }

[patch.crates-io]
jopemachine-raft = { path = "./raft-rs" }
raftify = { path = "./raftify" }
4 changes: 2 additions & 2 deletions examples/memstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ name = "raftify-client-example"
path = "src/client/main.rs"

[dependencies]
raftify.workspace = true

actix-rt = "2.10"
actix-web = "4.9.0"
async-trait = "0.1.82"
Expand All @@ -28,6 +26,8 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.40", features = ["full"] }
color-backtrace = "0.6.1"
raftify = { version = "0.1.78" }
raftify_cli = { version = "0.1.1" }

[features]
default = ["heed_storage"]
Expand Down
5 changes: 2 additions & 3 deletions examples/memstore/src/cli/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// use raftify::{cli::cli_handler, Result};
use raftify::Result;
use raftify_cli::cli_handler;

use memstore_example_harness::state_machine::{HashStore, LogEntry, StorageType};

#[tokio::main]
async fn main() -> Result<()> {
// cli_handler::<LogEntry, StorageType, HashStore>(None).await?;

cli_handler::<LogEntry, StorageType, HashStore>(None).await?;
Ok(())
}
3 changes: 0 additions & 3 deletions examples/memstore/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use std::{
sync::{Arc, RwLock},
};

#[cfg(feature = "inmemory_storage")]
pub use raftify::MemStorage as StorageType;

#[cfg(feature = "heed_storage")]
pub use raftify::HeedStorage as StorageType;

Expand Down
2 changes: 1 addition & 1 deletion raftify-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion raftify-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "raftify_cli"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "Raftify CLI tool"
license = "MIT/Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions raftify-cli/src/commands/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ use raftify::{
},
raft_node::utils::format_debugging_info,
raft_service, Config, Result, StableStorage,
HeedStorage, StorageType,
};

use raftify::{HeedStorage, StorageType};

pub fn debug_persisted<LogStorage: StableStorage>(path: &str, logger: slog::Logger) -> Result<()> {
let config = Config {
log_dir: path.to_string(),
Expand Down Expand Up @@ -80,6 +79,7 @@ pub fn debug_persisted_all<LogStorage: StableStorage>(
dir_entries.sort();

for name in dir_entries {
println!("*----- {name} -----*");
debug_persisted::<LogStorage>(&format!("{}/{}", path_str, name), logger.clone())?;
println!();
}
Expand Down

0 comments on commit a00de24

Please sign in to comment.