pub enum LogError {
Show 17 variants
Io(Error),
PartialBatch {
segment: Offset,
file_offset: u64,
},
CrcMismatch {
segment: Offset,
file_offset: u64,
expected: u32,
computed: u32,
},
OffsetTooLow {
requested: Offset,
log_start: Offset,
},
OffsetBelowLocalStart {
requested: Offset,
local_log_start: Offset,
},
Records(RecordsError),
BadSegmentName(String),
OffsetMismatch {
expected: Offset,
actual: Offset,
},
Corrupt(String),
UnsupportedFormatVersion {
artifact: &'static str,
path: PathBuf,
found: i64,
},
MissingFormatVersion {
artifact: &'static str,
path: PathBuf,
},
InvalidControlRecordSize {
record: &'static str,
needed: usize,
found: usize,
},
InvalidControlRecordVersion {
record: &'static str,
version: i16,
},
InvalidArgument(String),
RecordTooLarge {
size: usize,
limit: usize,
},
ScheduleRunsBackwards {
delivery_ms: i64,
},
Fenced,
}Variants§
Io(Error)
An I/O operation against the filesystem failed.
PartialBatch
Recovery found a partial batch at the tail of a .log file. The log
truncates the trailing bytes back to the last cleanly decoded batch.
Fields
CrcMismatch
A batch’s stored CRC did not match the one computed over its bytes.
Fields
OffsetTooLow
A caller requested an offset below Log::log_start_offset.
OffsetBelowLocalStart
A caller requested an offset that is at or above
Log::log_start_offset but below
Log::local_log_start_offset.
KIP-405: the records are in the remote tier and no local segment holds
them. The broker’s fetch path answers OFFSET_OUT_OF_RANGE and then
falls through to the remote reader, which is where these offsets are
served from.
Fields
Records(RecordsError)
The encode or decode of a RecordBatch failed.
BadSegmentName(String)
A segment filename would not parse. For example, it has the wrong length, or it is not all digits.
OffsetMismatch
A caller supplied an explicit offset to Log::append_at
that was below the log’s current end offset. Replication paths use
this to detect a duplicate or a divergence between leader-assigned offsets and the local
log’s expected next offset.
Fields
Corrupt(String)
A log file such as .txnindex is corrupt. It has the wrong size, a
bad checksum, or a similar defect.
UnsupportedFormatVersion
A persisted sidecar or checkpoint names a format version this build does not read. A future 1.x broker wrote it, or it is not the artifact its name says.
Fields
MissingFormatVersion
A persisted sidecar or checkpoint has no version marker. Only a broker before 1.0 wrote that layout, and 1.x reads no 0.x data.
Fields
InvalidControlRecordSize
A control record’s key or end-transaction-marker value is too short to
hold its fields. Kafka’s ControlRecordType.parseTypeId throws
InvalidRecordException for a short key, and
EndTransactionMarker.deserializeValue cannot read a short value.
Fields
InvalidControlRecordVersion
A control record names a negative key version or end-transaction-marker
value version. Kafka’s ControlRecordType.parseTypeId and
EndTransactionMarker.deserializeValue throw InvalidRecordException
for one: the bytes are corrupt. A version above the current one is not
this error; Kafka parses it as the current version.
Fields
InvalidArgument(String)
A caller supplied an invalid argument.
RecordTooLarge
Kafka trunk’s max.decompressed.message.bytes: a compressed batch that a
lookup or a compaction pass had to decompress holds a record whose body
is larger than LogConfig::max_decompressed_record.
Kafka throws InvalidRecordException from DefaultRecord.readFrom, and
the message is its own. The broker answers INVALID_RECORD (87) to a
ListOffsets, and the cleaner leaves the partition uncleanable until a
pass succeeds.
Fields
ScheduleRunsBackwards
KFC-1 delivery.schedule.monotonic: the appended batch’s delivery time
precedes a delivery time the partition already holds, so the batch
would make the partition’s schedule run backwards.
The log raises it because the log is what serializes appends: the test
and the write it guards are one critical section here and nowhere
above. The broker answers it with INVALID_TIMESTAMP (32).
Fenced
The log was fenced with Log::fence because its
partition is being removed, and takes no more appends.
Trait Implementations§
Source§impl Error for LogError
impl Error for LogError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for LogError
impl !UnwindSafe for LogError
impl Freeze for LogError
impl Send for LogError
impl Sync for LogError
impl Unpin for LogError
impl UnsafeUnpin for LogError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<F> FnGhost for F
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);