Skip to content

Commit

Permalink
v0.1.28
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jan 10, 2024
1 parent 6b48f23 commit 3570aa5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
12 changes: 6 additions & 6 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ default-members = [
]

[workspace.package]
version = "0.1.27"
version = "0.1.28"
authors = ["Lablup Inc."]
edition = "2021"
description = "Experimental High level Raft framework"
Expand Down
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.

4 changes: 2 additions & 2 deletions binding/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "raftify-py"
version = "0.1.27"
version = "0.1.28"
authors = ["Lablup Inc."]
license = "Apache-2.0"
repository = "https://github.com/lablup/raftify"
Expand All @@ -17,7 +17,7 @@ edition = "2021"
pyo3 = { git = "https://github.com/jopemachine/pyo3", features = ["extension-module", "multiple-pymethods"] }
tokio = { version = "1.4", features = ["full"] }
async-trait = "0.1.48"
raftify = { version = "0.1.27", default-features = false }
raftify = { version = "0.1.28", default-features = false }
slog = { version = "2.2", features = ["max_level_trace", "release_max_level_trace"] }
slog-envlogger = "2.1.0"
slog-term = "2.9.0"
Expand Down
1 change: 0 additions & 1 deletion binding/python/src/bindings/raft_rs/eraftpb/conf_state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use pyo3::{prelude::*, types::PyList};

use raftify::raft::eraftpb::ConfState;

use crate::bindings::errors::runtime_error;
Expand Down
15 changes: 7 additions & 8 deletions binding/python/src/bindings/raft_rs/eraftpb/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pyo3::{intern, prelude::*, types::PyBytes};
use pyo3::{prelude::*, types::PyBytes};

use raftify::raft::eraftpb::Snapshot;

Expand All @@ -23,27 +23,26 @@ impl PySnapshot {
!self.inner.is_empty()
}

pub fn get_data(&self, py: Python) -> PyResult<Py<PyBytes>> {
Ok(PyBytes::new(py, self.inner.get_data()).into_py(py))
pub fn get_data(&self, py: Python) -> Py<PyBytes> {
PyBytes::new(py, self.inner.get_data()).into_py(py)
}

pub fn set_data(&mut self, bytes: &PyAny) -> PyResult<()> {
let bytes = bytes.extract::<Vec<u8>>()?;
Ok(self.inner.set_data(bytes))
}

// TODO: Make &mut self to &self
pub fn get_metadata(&mut self) -> PySnapshotMetadata {
PySnapshotMetadata {
inner: self.inner.mut_metadata().clone(),
}
}

pub fn set_metadata(&mut self, snapshot_meta_data: PySnapshotMetadata) -> PyResult<()> {
Ok(self.inner.set_metadata(snapshot_meta_data.inner))
pub fn set_metadata(&mut self, snapshot_meta_data: PySnapshotMetadata) {
self.inner.set_metadata(snapshot_meta_data.inner)
}

pub fn has_metadata(&self) -> PyResult<bool> {
Ok(self.inner.has_metadata())
pub fn has_metadata(&self) -> bool {
self.inner.has_metadata()
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use pyo3::prelude::*;
use raftify::raft::eraftpb::SnapshotMetadata;

use super::conf_state::PyConfState;
use raftify::raft::eraftpb::SnapshotMetadata;

#[derive(Clone)]
#[pyclass(name = "SnapshotMetadata")]
Expand Down

0 comments on commit 3570aa5

Please sign in to comment.