Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8883 +/- ##
==========================================
- Coverage 82.48% 82.02% -0.47%
==========================================
Files 74 74
Lines 13367 13367
Branches 1977 1977
==========================================
- Hits 11026 10964 -62
- Misses 1682 1745 +63
+ Partials 659 658 -1 ☔ View full report in Codecov by Sentry. |
Replaced `ChunkerFixed`'s block-reading functionality with a new `FileReader` class to streamline code and improve separation of concerns. Adjusted `ChunkerFixed` to delegate file reading to `FileReader` while focusing on chunk assembly. `FileReader` is intended to be useful for other chunkers also, so they can easily implement sparse file reading / fmap support.
`FileFMAPReader` deals with sparse files (data vs holes) or fmap and yields blocks of some specific read_size using a generator. `FileReader` uses the `FileFMAPReader` to fill an internal buffer and lets users use its `read` method to read arbitrary sized chunks from the buffer. For both classes, instances now only deal with a single file.
The `header_size` parameter and related logic have been removed from file readers, simplifying their implementation. This change eliminates unnecessary complexity while maintaining all functional capabilities via `read_size` and `fmap`.
Simplified and improved handling of mixed types of chunks during reading. The allocation type of resulting chunks is now determined based on contributing chunks.
Includes cases for simple reads, multiple reads, and mock chunk scenarios to verify behavior with mixed allocation types. Also: change Chunk type for empty read result for better consistency.
Includes unit tests for basic functionality, handling of custom file maps, allocation types, sparse file support, and `_build_fmap` method.
Replaced inline file reading logic with `FileReader` to standardize handling across chunkers. Improved buffer updates and allocation handling for sparse files and optimized read operations.
8c978f5 to
5445a52
Compare
Could happen at EOF when remaining data is insufficient and no new data can be added.
22b0f90 to
a235cff
Compare
633f09a to
8fb5951
Compare
8fb5951 to
439c193
Compare
it tends to hang, not only on cygwin.
snorkelopstesting3-bot
pushed a commit
to snorkel-marlin-repos/borgbackup_borg_pr_8883_0c7b7ea4-7cd4-4969-8f9a-f027bdeb5ea3
that referenced
this pull request
Oct 22, 2025
Original PR #8883 by ThomasWaldmann Original: borgbackup/borg#8883
snorkelopstesting2-coder
added a commit
to snorkel-marlin-repos/borgbackup_borg_pr_8883_0c7b7ea4-7cd4-4969-8f9a-f027bdeb5ea3
that referenced
this pull request
Oct 22, 2025
Merged from original PR #8883 Original: borgbackup/borg#8883
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
transform buzhash chunker C code to Cython
split concerns into FileFMAPReader, FileReader, Chunker:
.read(size)method so they can read arbitrarily sized pieces of the data.more tests