pub struct LogDirDescription { /* private fields */ }Expand description
A description of a log directory on a particular broker.
Corresponds to org.apache.kafka.clients.admin.LogDirDescription.
Implementations§
Source§impl LogDirDescription
impl LogDirDescription
Sourcepub fn new(
error: Option<Error>,
replica_infos: HashMap<TopicPartition, ReplicaInfo>,
) -> Self
pub fn new( error: Option<Error>, replica_infos: HashMap<TopicPartition, ReplicaInfo>, ) -> Self
Creates a new LogDirDescription with unknown volume sizes.
Corresponds to the two-argument LogDirDescription(ApiException, Map)
constructor.
Sourcepub fn with_total_bytes_usable_bytes(
error: Option<Error>,
replica_infos: HashMap<TopicPartition, ReplicaInfo>,
total_bytes: i64,
usable_bytes: i64,
) -> Self
pub fn with_total_bytes_usable_bytes( error: Option<Error>, replica_infos: HashMap<TopicPartition, ReplicaInfo>, total_bytes: i64, usable_bytes: i64, ) -> Self
Creates a new LogDirDescription with the given raw volume sizes and no
cordoning. A raw value of UNKNOWN_VOLUME_BYTES (-1) maps to None.
Corresponds to the four-argument
LogDirDescription(ApiException, Map, long, long) constructor.
Sourcepub fn with_total_bytes_usable_bytes_is_cordoned(
error: Option<Error>,
replica_infos: HashMap<TopicPartition, ReplicaInfo>,
total_bytes: i64,
usable_bytes: i64,
is_cordoned: bool,
) -> Self
pub fn with_total_bytes_usable_bytes_is_cordoned( error: Option<Error>, replica_infos: HashMap<TopicPartition, ReplicaInfo>, total_bytes: i64, usable_bytes: i64, is_cordoned: bool, ) -> Self
Creates a new LogDirDescription with the given raw volume sizes and
cordoning flag. A raw value of UNKNOWN_VOLUME_BYTES (-1) maps to
None.
Corresponds to the five-argument
LogDirDescription(ApiException, Map, long, long, boolean) constructor
(KIP-1066).
Sourcepub fn error(&self) -> Option<&Error>
pub fn error(&self) -> Option<&Error>
Returns the error if the log directory is offline or an error occurred,
otherwise None.
KafkaStorageError— the log directory is offline.UnknownServerError— the server experienced an unexpected error.
Sourcepub fn replica_infos(&self) -> &HashMap<TopicPartition, ReplicaInfo>
pub fn replica_infos(&self) -> &HashMap<TopicPartition, ReplicaInfo>
A map from topic partition to replica information for that partition in this log directory.
Sourcepub fn total_bytes(&self) -> Option<i64>
pub fn total_bytes(&self) -> Option<i64>
The total size in bytes of the volume this log directory is on, or None
if the broker did not return a value.
Sourcepub fn usable_bytes(&self) -> Option<i64>
pub fn usable_bytes(&self) -> Option<i64>
The usable size in bytes of the volume this log directory is on, or
None if the broker did not return a value.
Sourcepub fn is_cordoned(&self) -> bool
pub fn is_cordoned(&self) -> bool
Whether this log directory is cordoned or not.
Trait Implementations§
Source§impl Clone for LogDirDescription
impl Clone for LogDirDescription
Source§fn clone(&self) -> LogDirDescription
fn clone(&self) -> LogDirDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more