Skip to content

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Jul 28, 2025

This commit updates Builder.Flush to return an Object rather than writing bytes to an argument. To support this change, dataobj.Object has two additional methods:

  • dataobj.Object.Size, to retrieve the full encoded size of the object
  • dataobj.Object.Reader, to read from the encoded object

This API change allows downstream users of dataobj.Builder to stream the encoded object for analysis or uploading, without requiring the caller to retain the entire object in memory at once.

In the future, this will be used to reduce the memory overhead of dataobj-consumers by buffering flushed sections on an ephemeral disk instead of in memory.

@rfratto rfratto requested a review from a team as a code owner July 28, 2025 18:23
@rfratto rfratto force-pushed the dataobj-flush-to-object branch from 376aa91 to fefc514 Compare July 28, 2025 18:31
This commit updates Builder.Flush to return an Object rather than
writing bytes to an argument. To support this change, dataobj.Object has
two additional methods:

- dataobj.Object.Size, to retrieve the full encoded size of the object
- dataobj.Object.Reader, to read from the encoded object

This API change allows downstream users of dataobj.Builder to stream the
encoded object for analysis or uploading, without requiring the caller
to retain the entire object in memory at once.

In the future, this will be used to reduce the memory overhead of
dataobj-consumers by buffering flushed sections on an ephemeral disk
instead of in memory.
@rfratto rfratto force-pushed the dataobj-flush-to-object branch from fefc514 to a3564cd Compare July 28, 2025 19:25
@rfratto rfratto mentioned this pull request Aug 1, 2025
6 tasks
Copy link
Contributor

@grobinson-grafana grobinson-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed it, LGTM. If you want a more thorough review please let me know!

@rfratto rfratto merged commit d4b027a into grafana:main Aug 6, 2025
65 checks passed
@rfratto rfratto deleted the dataobj-flush-to-object branch August 6, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants