chronix_engine/compaction/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum CompactionError {
8 #[error("No segments eligible for compaction")]
10 NoEligibleSegments,
11
12 #[error("Segment error: {0}")]
14 Segment(#[from] crate::segment::SegmentError),
15
16 #[error("Encoding error: {0}")]
18 Encoding(#[from] chronix_encoding::EncodingError),
19
20 #[error("Index error: {0}")]
22 Index(#[from] crate::index::IndexError),
23
24 #[error("I/O error: {0}")]
26 Io(#[from] std::io::Error),
27
28 #[error("Internal compaction error: {0}")]
30 Internal(String),
31
32 #[error("Compaction timeout: task exceeded {0}ms limit")]
34 TaskTimeout(u64),
35
36 #[error("Compaction input too large: {loaded_bytes} bytes exceeds {limit_bytes} byte limit")]
38 InputTooLarge {
39 loaded_bytes: u64,
41 limit_bytes: u64,
43 },
44}
45
46pub type Result<T> = std::result::Result<T, CompactionError>;