Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Barrier snapshots: the frozen container, the storage seam, and the shared byte-store payload codec.

A task snapshots every store it owns when a barrier fires. The result is a map from store name to opaque payload bytes, and the container below holds it. The container is frozen. krabka-streams-rs, krabka-streams-java, and krabka-streams-go write the same bytes:

version u32 = 1
count   u32
entries count x [ name_len u32 | name UTF-8 | value_len u32 | value bytes ]

Every integer is big-endian. The entries are in ascending byte order of the name, so one snapshot always encodes to one byte string.

The payload inside an entry is language-specific. Rust uses the byte-store payload that [encode_byte_entries] writes for every store over the pluggable byte backend, and a store with in-process state of its own writes its own payload.

The cut identity is not in the container. It is the storage key, which is the task, the barrier group, and the epoch. See SnapshotKey.

Structs§

FileSnapshotStore
Writes each snapshot to one file under a directory.
NoSnapshotStore
A snapshot store that keeps nothing.
SnapshotKey
Names one stored snapshot: the task, the barrier group, and the epoch.

Constants§

SNAPSHOT_CONTAINER_VERSION
The container version that the three streams libraries share.

Traits§

SnapshotStore
Keeps the store snapshots a task takes at each barrier cut.

Functions§

decode_snapshot
Decodes the frozen container bytes back into a task snapshot.
encode_snapshot
Encodes a task snapshot into the frozen container bytes.

Type Aliases§

TaskSnapshot
Every store of one task at one cut, as store name to payload bytes.