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 8a82411 commit 0416bec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 1 addition & 2 deletions examples/memstore/src/web_server_api.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::collections::HashMap;

use actix_web::{get, put, web, Responder};
use raftify::raft::Storage;
use raftify::{AbstractLogEntry, StableStorage};
use raftify::{raft::Storage, AbstractLogEntry, StableStorage};
use serde_json::Value;

use crate::state_machine::{HashStore, LogEntry, Raft};
Expand Down
2 changes: 1 addition & 1 deletion raftify/src/cli/commands/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};

#[cfg(feature = "inmemory_storage")]
use raftify::MemStorage;
use crate::MemStorage;

#[cfg(feature = "heed_storage")]
use crate::HeedStorage;
Expand Down
9 changes: 7 additions & 2 deletions raftify/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ use std::{fmt::Debug, sync::Arc};

use crate::{
raft::{default_logger, formatter::set_custom_formatter},
AbstractLogEntry, AbstractStateMachine, Config, CustomFormatter, HeedStorage, Result,
StableStorage,
AbstractLogEntry, AbstractStateMachine, Config, CustomFormatter, Result, StableStorage,
};

#[cfg(feature = "inmemory_storage")]
use crate::MemStorage;

#[cfg(feature = "heed_storage")]
use crate::HeedStorage;

#[derive(Parser)]
#[command(name = "raftify")]
#[command(version = PKG_VERSION)]
Expand Down
5 changes: 2 additions & 3 deletions raftify/src/raft_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ pub struct RaftNodeCore<
FSM: AbstractStateMachine + Clone + 'static,
> {
pub raw_node: RawNode<LogStorage>,
pub log_storage: LogStorage,

// pub log_storage: LogStorage,
pub fsm: FSM,
pub peers: Arc<Mutex<Peers>>,
response_seq: AtomicU64,
Expand Down Expand Up @@ -577,7 +576,6 @@ impl<

Ok(RaftNodeCore {
raw_node,
log_storage,
fsm,
response_seq,
config,
Expand All @@ -594,6 +592,7 @@ impl<
tx_self,
rx_self,
_phantom_log_entry_typ: PhantomData,
// log_storage,
})
}

Expand Down

0 comments on commit 0416bec

Please sign in to comment.