Skip to content

Simple entry iterator#209

Closed
MarcialRosales wants to merge 5 commits intostream_offset_landmarksfrom
simple-entry-iterator
Closed

Simple entry iterator#209
MarcialRosales wants to merge 5 commits intostream_offset_landmarksfrom
simple-entry-iterator

Conversation

@MarcialRosales
Copy link
Contributor

@MarcialRosales MarcialRosales commented Feb 26, 2026

What is the entry iterator?

When iterating over stream chunks with new entry_iterator mode created by this PR, the log can return an entry iterator instead of a full in-memory entry. An entry iterator is a handle to read the current entry’s bytes in bounded chunks via entry_iterator_read/2 (and to skip bytes via entry_iterator_skip/2).

Why do we need it?
The stream protocol limits a single message to the frame size (typically 1 MiB), so normally an entry can be returned as one Entry. Other protocols (e.g. AMQP 0-9-1) can publish much larger messages into a stream. Loading those as a single Entry would be unsafe. Returning an entry iterator lets callers read a fixed number of bytes at a time (e.g. the AMQP 1.0 section descriptor and size), then decide whether to read or skip the rest of the section.

@MarcialRosales MarcialRosales changed the base branch from main to stream_offset_landmarks February 26, 2026 17:28
@MarcialRosales MarcialRosales self-assigned this Feb 26, 2026
WIP: Test different read/skip scnearios
Where the read number of bytes < requested bytes
@MarcialRosales MarcialRosales deleted the simple-entry-iterator branch February 27, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant