Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Sep 30, 2024
1 parent 26bba81 commit bad8c80
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
6 changes: 3 additions & 3 deletions binding/python/Cargo.lock

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

8 changes: 1 addition & 7 deletions binding/python/src/bindings/abstract_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ use async_trait::async_trait;
use once_cell::sync::Lazy;
use pyo3::{prelude::*, types::PyBytes};
use pyo3_asyncio::TaskLocals;
use raftify::{
raft::{
prelude::{ConfState, Entry, HardState, Snapshot},
GetEntriesContext, RaftState, Storage,
},
AbstractLogEntry, AbstractStateMachine, Error, Result,
};
use raftify::{AbstractLogEntry, AbstractStateMachine, Error, Result};
use std::{fmt, sync::Mutex};

use super::{
Expand Down
2 changes: 1 addition & 1 deletion binding/python/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ pub mod confchange_request;
pub mod config;
pub mod errors;
pub mod formatter;
pub mod initial_role;
pub mod logger;
pub mod peer;
pub mod peers;
pub mod raft_bootstrapper;
pub mod raft_client;
pub mod raft_node;
pub mod raft_rs;
pub mod initial_role;
pub mod slogger;
pub mod utils;
2 changes: 1 addition & 1 deletion binding/python/src/bindings/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use raftify::Peers;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, hash::BuildHasherDefault};

use super::{peer::PyPeer, initial_role::PyInitialRole};
use super::{initial_role::PyInitialRole, peer::PyPeer};

#[derive(Serialize, Deserialize, Clone)]
#[pyclass(dict, name = "Peers")]
Expand Down
13 changes: 6 additions & 7 deletions binding/python/src/bindings/raft_bootstrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ impl PyRaftFacade {
&config.log_dir.clone(),
&config.clone().into(),
Arc::new(PyLogger::new(logger.clone())),
).expect("Failed to create heed storage");
)
.expect("Failed to create heed storage");

let raft = Raft::bootstrap(
node_id,
Expand All @@ -56,12 +57,10 @@ impl PyRaftFacade {
py: Python<'a>,
) -> PyResult<&'a PyAny> {
future_into_py(py, async move {
let ticket = Raft::<PyLogEntry, HeedStorage, PyFSM>::request_id(
raft_addr,
peer_addr.to_owned(),
)
.await
.unwrap();
let ticket =
Raft::<PyLogEntry, HeedStorage, PyFSM>::request_id(raft_addr, peer_addr.to_owned())
.await
.unwrap();
Ok(PyClusterJoinTicket { inner: ticket })
})
}
Expand Down
2 changes: 1 addition & 1 deletion binding/python/src/bindings/raft_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use raftify::{HeedStorage, RaftNode};
use super::{
abstract_types::{PyFSM, PyLogEntry},
cluster_join_ticket::PyClusterJoinTicket,
initial_role::PyInitialRole,
peers::PyPeers,
raft_rs::eraftpb::{conf_change_v2::PyConfChangeV2, message::PyMessage},
initial_role::PyInitialRole,
};

#[derive(Clone)]
Expand Down

0 comments on commit bad8c80

Please sign in to comment.