Expand description
Transport seam for the KraftController.
Outbound peer RPCs go through PeerSender, which is real TCP in
production and in-memory in tests. Inbound KIP-595 RPCs arrive as
Inbound, which carries a oneshot reply channel. Handle-facing requests
arrive as Command.
This module is the wire-agnostic boundary: the event loop never touches
sockets directly. In-memory tests and real TCP both implement PeerSender
against the same command and inbound plumbing.
§Peer codec
Peer RPC request and response bodies are encoded with the generated KIP-595
message codecs in wire. The engine encodes a PeerRequest into the body
it hands to PeerSender::send. The receiving transport drives the peer
engine and returns a PeerResponse. The sending engine then decodes that
response into the matching core Event, which
is ReceiveVoteResponse or ReceiveFetchResponse. This keeps the send path
fire-and-forget: the engine never .awaits a peer RPC inline.
Re-exports§
pub use self::api_key::PeerApi;
Modules§
Structs§
- Command
Sender - The sending half of the engine’s mpsc. It stamps each
Commandwith the instant it was sent, before any wait for room in the queue, as Kafka stamps an event when it creates it. - Metadata
Fetch Slice - A committed-range read result for the observer metadata-fetch path (1004).
- Null
Peer Sender - A no-op
PeerSenderfor single-voter and no-network tests. Every send fails as unreachable. - Observer
Replica - One observer row of
DescribeQuorum: a replica the leader has seen fetch that is not a voter, with what the leader tracks for it. - Queued
Command - A
Commandon the engine’s mpsc, with the instant it was sent: the start of its KafkaEventQueueTimeMs. - Quorum
State Snapshot - A structured, node-local snapshot of consensus state for the handle, which
serves the broker’s
DescribeQuorumadmin view.
Enums§
- Command
- Everything that arrives on the engine’s mpsc and drives one turn of the loop.
- Inbound
- An inbound KIP-595 RPC body, the request version its header carried, and a oneshot to reply on.
- Timer
Tick - Which timer fired. The loop interprets the tick against the current role and liveness state, and does not map it one-to-one to a core event.
Traits§
- Peer
Sender - Outbound peer RPC sender.