Closed v0y4g3r closed 1 month ago
[!NOTE]
Reviews paused
Use the following commands to manage reviews:
@coderabbitai resume
to resume automatic reviews.@coderabbitai review
to trigger a single review.
The recent update introduces a new RowGroupLastRowCachedReader
enum and related structs for efficient last row caching in row groups. It also modifies the SelectorResultKey
struct to derive Copy
and adjusts module visibility and imports accordingly. These changes enhance the caching mechanism and simplify the codebase by using more efficient data structures.
File Path | Change Summary |
---|---|
src/mito2/src/cache.rs |
SelectorResultKey struct now derives Copy in addition to existing traits |
src/mito2/src/read.rs |
Changed visibility of the last_row module from pub(crate) to pub |
src/mito2/src/read/last_row.rs |
Introduced RowGroupLastRowCachedReader enum, structs for cached row management, etc. |
src/mito2/src/read/prune.rs |
Updated types and methods to use RowGroupLastRowCachedReader instead of LastRowReader |
src/mito2/src/sst/parquet/file_range.rs |
Replaced LastRowReader with RowGroupLastRowCachedReader in imports and instantiation |
src/mito2/src/sst/parquet/reader.rs |
Added cache_manager and context methods in RowGroupReaderBuilder and RowGroupReader |
sequenceDiagram
participant Client
participant CacheManager
participant RowGroupLastRowCachedReader
Client->>RowGroupLastRowCachedReader: Request last row
RowGroupLastRowCachedReader->>CacheManager: Check cache
alt Cache Hit
CacheManager-->>RowGroupLastRowCachedReader: Return cached last row
else Cache Miss
CacheManager-->>RowGroupLastRowCachedReader: Cache miss
RowGroupLastRowCachedReader->>Client: Fetch last row data
RowGroupLastRowCachedReader->>CacheManager: Update cache with new data
end
RowGroupLastRowCachedReader-->>Client: Return last row
As code evolves, we make it bright,
With caches swift and enums in sight.
Last rows are read with utmost care,
Efficient and sleek, changes everywhere.
A rabbit’s cheer for code refined,
In every byte, improvements aligned. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai pause
@coderabbitai summary
Attention: Patch coverage is 76.63551%
with 25 lines
in your changes missing coverage. Please review.
Project coverage is 84.88%. Comparing base (
7b28da2
) to head (0d516e9
).
RowGroupLastRowCachedReader
to handle cache hits and misses for last row reads.I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
This PR adds a
RowGroupLastRowCachedReader
that reads the last rows of row group from cache if hit.Otherwise, the reader reads last rows from parquet row group and puts the results to cache for later use.
As coderabbitai said
Checklist
Summary by CodeRabbit
New Features
RowGroupLastRowCachedReader
enum for efficient cached last row reading.LastRowCacheReader
andRowGroupLastRowReader
structs for managing and iterating cached last rows.Improvements
RowGroupReaderBuilder
andRowGroupReader
with new methods for cache management and context handling.Refactor
RowGroupLastRowCachedReader
for better cache handling and performance.