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

CasObject v2 #16

Merged
merged 20 commits into from
Sep 20, 2024
Merged

CasObject v2 #16

merged 20 commits into from
Sep 20, 2024

Conversation

rajatarya
Copy link
Collaborator

  • Changes header to footer.
  • Supports chunk compression and chunk headers
  • Updated unit-tests

Hoyt Koepke and others added 9 commits September 16, 2024 16:47
* change range to u32

* remove conversions
- Moved info_length outside of CasObjectInfo and in CasObject
- Updated default length of Info struct
cas_object now has header moved to footer, handles ranges, and can
support chunk compression.

All unit-tests are passing, and a couple new unit-tests are written to
support the changes to CasObjectInfo structs.
CompressionScheme::None => compressed_buf,
CompressionScheme::LZ4 => {
let mut uncompressed_buf = Vec::new();
let mut dec = FrameDecoder::new(Cursor::new(compressed_buf));
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could also just pass the reader in here?

Copy link
Contributor

@assafvayner assafvayner Sep 19, 2024

Choose a reason for hiding this comment

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

What if the reader is longer than the rest of the chunk? Maybe best to just do a .take()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the concern @assafvayner is raising is that we only want to read/decode the length of this chunk, so is there a way to only copy a specific number of bytes from reader -> writer without introducing an in-memory buffer?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes this is the second piece, the lz4_flex library doesn't give you a good way to know how much was written. That being said there is a really easy change to make the library make the info available, there was a PR for it, no progress since. We could fork it and do that.

@rajatarya rajatarya requested a review from hoytak September 20, 2024 00:43
Copy link
Collaborator

@hoytak hoytak left a comment

Choose a reason for hiding this comment

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

LGTM

@rajatarya rajatarya merged commit 037d267 into main Sep 20, 2024
1 check passed
@rajatarya rajatarya deleted the cas_object_v2 branch September 20, 2024 19:16
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.

4 participants