1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Metadata Raft quorum for Crabka.
//!
//! `crabka-raft` runs a hand-rolled KIP-595 `KRaft` consensus engine (the
//! [`kraft::KraftController`]) over Crabka's storage ([`crabka_log`]) and
//! transport ([`crabka_client_core`]). The public entry point is
//! [`Controller::start`], which spawns the engine, opens a TCP listener serving
//! the real KIP-595 RPCs (Fetch=1, Vote=52, BeginQuorumEpoch=53,
//! EndQuorumEpoch=54) plus the Crabka-private observer/forward RPCs, and returns
//! a [`ControllerHandle`] for submitting metadata changes and reading the
//! current [`crabka_metadata::MetadataImage`].
//!
//! ## Quick start
//!
//! ```no_run
//! use crabka_metadata::{MetadataRecord, TopicRecord};
//! use crabka_raft::{Controller, ControllerConfig};
//! use std::time::Duration;
//! use uuid::Uuid;
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let dir = tempfile::tempdir()?;
//! let cfg = ControllerConfig::for_tests(1, dir.path().to_path_buf());
//! let controller = Controller::start(cfg).await?;
//!
//! controller
//! .submit_change(vec![MetadataRecord::V1Topic(TopicRecord {
//! name: "my-topic".into(),
//! topic_id: Uuid::new_v4(),
//! partitions: 3,
//! replication_factor: 1,
//! })])
//! .await?;
//!
//! assert!(controller.current_image().topic("my-topic").is_some());
//! controller.shutdown().await;
//! # Ok(())
//! # }
//! ```
//!
//! ## Capabilities and boundaries
//!
//! The controller persists and recovers `KRaft` metadata records, serves and
//! installs KIP-630 snapshots through `FetchSnapshot`, publishes the current
//! metadata image to broker tasks, and exposes Crabka-private submit/fetch RPCs
//! for broker and observer integration. KIP-853-style observer bootstrap and
//! auto-join are wired through the broker/controller configuration; the older
//! handle-level `add_learner` / `change_membership` compatibility methods still
//! return [`RaftError::Unsupported`]. Mixed JVM+Crabka controller quorums are
//! outside this crate's compatibility target.
pub use ;
pub use ;
pub use RaftError;
pub use ;
pub use MetadataFetchSlice;
pub use ;
pub use ;
pub use ;
pub use ;