Struct segments::MemoryLog[][src]

pub struct MemoryLog<T> { /* fields omitted */ }
Expand description

Log is an inmemory commitlog (per topic) which splits data in segments. It drops the oldest segment when retention policies are crossed. Each segment is identified by base offset and a new segment is created when ever current segment crosses disk limit

Implementations

Create a new log

Appends this record to the tail and returns the offset of this append. When the current segment is full, this also create a new segment and writes the record to it. This function also handles retention by removing head segment

Read a record from correct segment

Reads multiple packets from the disk and returns base offset and offset of the next log. When data of deleted segment is asked, returns data of the current head Note: segment id is used to be able to pull directly from correct segment Note: This method also returns full segment data when requested data is not of active segment. Set your max_segment size keeping tail latencies of all the concurrent connections mind (some runtimes support internal preemption using await points)

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.