pub struct LogDirDescription { /* private fields */ }Expand description
A description of a log directory on a particular broker.
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.
§Arguments
error- the error if the log directory is offline or an error occurred, otherwiseNone.replica_infos- the replicas of the log directory, by partition.
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.
§Arguments
error- the error if the log directory is offline or an error occurred, otherwiseNone.replica_infos- the replicas of the log directory, by partition.total_bytes- the total size of the volume, orUNKNOWN_VOLUME_BYTES(-1).usable_bytes- the usable size of the volume, orUNKNOWN_VOLUME_BYTES(-1).
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.
§Arguments
error- the error if the log directory is offline or an error occurred, otherwiseNone.replica_infos- the replicas of the log directory, by partition.total_bytes- the total size of the volume, orUNKNOWN_VOLUME_BYTES(-1).usable_bytes- the usable size of the volume, orUNKNOWN_VOLUME_BYTES(-1).is_cordoned- whether the log directory is cordoned.
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>
Returns 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>
Returns the total size of the volume this log directory is on or None if the broker did
not return a value. For volumes larger than i64::MAX, i64::MAX is returned. This
value does not include the size of data stored in remote storage.
Sourcepub fn usable_bytes(&self) -> Option<i64>
pub fn usable_bytes(&self) -> Option<i64>
Returns the usable size on the volume this log directory is on or None if the broker
did not return a value. For usable sizes larger than i64::MAX, i64::MAX is returned.
This value does not include the size of data stored in remote storage.
Sourcepub fn is_cordoned(&self) -> bool
pub fn is_cordoned(&self) -> bool
Returns 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