Trait JournalHandle

Source
pub trait JournalHandle: ReadObjectHandle {
    // Required methods
    fn end_offset(&self) -> Option<u64>;
    fn push_extent(&mut self, added_offset: u64, device_range: Range<u64>);
    fn discard_extents(&mut self, discard_offset: u64);
}
Expand description

Handles for journal-like objects have some additional functionality to manage their extents, since during replay we need to add extents as we find them.

Required Methods§

Source

fn end_offset(&self) -> Option<u64>

The end offset of the last extent in the JournalHandle. Used only for validating extents (which will be skipped if None is returned). Note this is equivalent in value to ReadObjectHandle::get_size, when present.

Source

fn push_extent(&mut self, added_offset: u64, device_range: Range<u64>)

Adds an extent to the current end of the journal stream. added_offset is the offset into the journal of the transaction which added this extent, used for discard_extents.

Source

fn discard_extents(&mut self, discard_offset: u64)

Discards all extents which were added in a transaction at offset >= |discard_offset|.

Implementors§