Repository navigation
fix(cpp): address review notes on the reusable TsBlock change - #1099
Merged
Merged
Conversation
* DeviceOrderedTsBlockReader: call set_reusable_block() after the null check of the reader it is invoked on. * TsFileSeriesScanIterator: the factory contract said a returned block must already be reset, while alloc_or_reuse_tsblock() resets it unconditionally; document what the code does. * Pass the layout as `const TupleDesc&` through TsBlockFactory and ReusableTsBlock::acquire(), adding the const TupleDesc::operator[] overload that needs. * reusable_tsblock_test: fill every column of the block in the layout test, and read both value columns back through the production bulk_copy_into() path (the second column was never asserted).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1099 +/- ##
===========================================
- Coverage 66.55% 66.54% -0.01%
===========================================
Files 782 782
Lines 56709 56710 +1
Branches 9134 9134
===========================================
- Hits 37743 37739 -4
- Misses 17304 17309 +5
Partials 1662 1662 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Follow-up to the review comments on #1097, which is already merged. None of
these change behaviour on the hot path; they fix an ordering that would
dereference an unchecked pointer, align a contract comment with the code,
tighten const-correctness, and close two test-coverage gaps.
DeviceOrderedTsBlockReader::has_next()calledset_reusable_block()onthe freshly allocated reader before the existing null check.
TsFileSeriesScanIterator's factory contract claimed a returned block mustalready be reset;
alloc_or_reuse_tsblock()always resets it, so documentthat instead.
TsBlockFactory/ReusableTsBlock::acquire()now take the layout asconst TupleDesc&(the factory only reads it), which needs a constTupleDesc::operator[]overload.ReusesTheBlockForTheSameLayoutnow appends every column of the block, andConsecutiveDeviceScansShareOneBlockreads both value columns back throughthe production
bulk_copy_into()path; previously only the first valuecolumn was asserted.
Testing: full
TsFile_Test(1474 tests, 1471 passed, 3 skipped) and./mvnw -q -P with-cpp spotless:check.