Wal class final

Append-only write-ahead log over a SyncStorageFile.

The log knows nothing about memtables or segments: replaySync hands raw frame payloads to a callback and truncates any torn tail it finds.

The core is synchronous because the engine's hot path is: three nested awaits per insert used to cost more than the insert itself. Async wrappers exist for callers that already live in a Future world.

Constructors

Wal(SyncStorageFile file)
Wraps file as a write-ahead log.

Properties

file → SyncStorageFile
Backing file.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

append(Uint8List payload) → Future<void>
Async facade over appendSync.
appendBatch(List<WalOp> ops) → Future<void>
Async facade over appendBatchSync.
appendBatchSync(List<WalOp> ops) → void
Appends ops as one batch frame.
appendDeleteSync(Uint8List key) → void
Appends a single delete without building a WalOp or a list.
appendPutSync(Uint8List key, Uint8List value) → void
Appends a single put without building a WalOp or a list.
appendSync(Uint8List payload) → void
Appends one frame. The frame is not durable until sync.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replay(void apply(Uint8List key)) → Future<int>
Async facade over replaySync.
replaySync(void apply(Uint8List key), {bool truncateTorn = true}) → int
Replays every intact frame and truncates a torn tail.
sync() → Future<void>
Async facade over syncNow.
syncNow() → void
Makes every appended frame durable.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited