DocArena class final

Append-only byte store for encoded documents.

Documents are copied into fixed-size chunks; chunks are never moved, so a Bytes view handed out by view stays valid for the life of the arena. This is what lets the memtable store references instead of document copies and keeps reads zero-copy.

Constructors

DocArena({int chunkSize = 1 << 20})
Creates an arena with chunkSize bytes per chunk.

Properties

bytesUsed → int
Total bytes appended since creation (including superseded values).
no setter
chunkCount → int
Number of allocated chunks.
no setter
chunkSize → int
Chunk capacity in bytes.
no setter
currentChunkUsed → int
Bytes written into the current chunk.
no setter
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 bytes) → MemRef
Copies bytes into the arena and returns a reference to it.
chunkBytes(int index) → Uint8List
Raw chunk bytes, for flushing into blocks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
view(int chunk, int offset, int length) → Bytes
Zero-copy view of a previously appended range.

Operators

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