Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,9 @@ pub use raft_proto::eraftpb;
pub use raft_proto::protocompat;
#[allow(deprecated)]
pub use raw_node::is_empty_snap;
pub use raw_node::{LightReady, Peer, RawNode, Ready, SnapshotStatus};
pub use raw_node::{LightReady, RawNode, Ready, SnapshotStatus};
#[allow(deprecated)]
pub use raw_node::Peer;
pub use read_only::{ReadOnlyOption, ReadState};
pub use status::Status;
pub use storage::{GetEntriesContext, RaftState, Storage};
Expand All @@ -559,7 +561,9 @@ pub mod prelude {

pub use crate::storage::{RaftState, Storage};

pub use crate::raw_node::{Peer, RawNode, Ready, SnapshotStatus};
pub use crate::raw_node::{RawNode, Ready, SnapshotStatus};
#[allow(deprecated)]
pub use crate::raw_node::Peer;

pub use crate::Progress;

Expand Down
14 changes: 11 additions & 3 deletions src/raw_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ type Bytes = bytes::Bytes;
#[cfg(not(feature = "protobuf-codec"))]
type Bytes = Vec<u8>;

/// Represents a Peer node in the cluster.
/// Represents a peer node in the cluster.
///
/// This type is no longer used by the crate. Earlier versions accepted an initial peer
/// set when constructing a node and bootstrapped the cluster by turning those peers into
/// `ConfChange` entries, using each peer's `context` as the change's context. That path
/// has been removed: a cluster is now bootstrapped by the application proposing
/// `ConfChange` entries itself (see `RawNode::propose_conf_change`).
#[derive(Debug, Default)]
#[deprecated(
note = "Peer is unused; bootstrap a cluster by proposing ConfChange entries via RawNode::propose_conf_change"
)]
pub struct Peer {
/// The ID of the peer.
pub id: u64,
/// If there is context associated with the peer (like connection information), it can be
/// serialized and stored here.
/// Opaque context that earlier versions attached to this peer's bootstrap `ConfChange`.
pub context: Option<Vec<u8>>,
}

Expand Down