-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose low-level metadata to user
Helpful for debugging and certain admin operations like topic re-assignment and leader election.
- Loading branch information
1 parent
eea2003
commit 0c5b67d
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//! Cluster-wide Kafka metadata. | ||
/// Metadata container for the entire cluster. | ||
#[derive(Debug, PartialEq)] | ||
pub struct Metadata { | ||
/// Brokers. | ||
pub brokers: Vec<MetadataBroker>, | ||
|
||
/// The ID of the controller broker. | ||
pub controller_id: Option<i32>, | ||
|
||
/// Topics. | ||
pub topics: Vec<MetadataTopic>, | ||
} | ||
|
||
/// Metadata for a certain broker. | ||
#[derive(Debug, PartialEq)] | ||
pub struct MetadataBroker { | ||
/// The broker ID | ||
pub node_id: i32, | ||
|
||
/// The broker hostname | ||
pub host: String, | ||
|
||
/// The broker port | ||
pub port: i32, | ||
|
||
/// Rack. | ||
pub rack: Option<String>, | ||
} | ||
|
||
/// Metadata for a certain topic. | ||
#[derive(Debug, PartialEq)] | ||
pub struct MetadataTopic { | ||
/// The topic name | ||
pub name: String, | ||
|
||
/// True if the topic is internal | ||
pub is_internal: Option<bool>, | ||
|
||
/// Each partition in the topic | ||
pub partitions: Vec<MetadataPartition>, | ||
} | ||
|
||
/// Metadata for a certain partition. | ||
#[derive(Debug, PartialEq)] | ||
pub struct MetadataPartition { | ||
/// The partition index | ||
pub partition_index: i32, | ||
|
||
/// The ID of the leader broker | ||
pub leader_id: i32, | ||
|
||
/// The set of all nodes that host this partition | ||
pub replica_nodes: Vec<i32>, | ||
|
||
/// The set of all nodes that are in sync with the leader for this partition | ||
pub isr_nodes: Vec<i32>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters