Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a Reader for TLV metadata #86

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Expose a Reader for TLV metadata #86

merged 2 commits into from
Aug 21, 2023

Conversation

jessejlt
Copy link
Member

When extracting TLV metadata from our WAL segments, we need to be mindful that the checksum is calculated against the entire segment, including any potential TLV metadata; however, when reading one of these TLV-encoded Segments, we need to provide a way to expose the TLV while also removing it from the underlying byte-stream when read. By exposing a TLV io.Reader, we can wrap our Segment reader in such a way that TLV can still be extracted, checksums apply to the TLV, but callers, like Kusto::Ingest, do not have TLV bytes when they read the segment.

@jwilder
Copy link
Collaborator

jwilder commented Aug 18, 2023

Can you add a benchmark for this so we can easily profile it?

@jwilder jwilder self-requested a review August 18, 2023 17:15
pkg/tlv/tlv.go Outdated Show resolved Hide resolved
pkg/tlv/tlv.go Outdated Show resolved Hide resolved
@jessejlt jessejlt merged commit d7428f2 into main Aug 21, 2023
3 checks passed
@jessejlt jessejlt deleted the jesse/tlv-reader branch August 21, 2023 17:58
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.

2 participants