Closed v0y4g3r closed 2 weeks ago
The recent changes introduce caching and metric functionalities to the Greptime project, focusing on improving performance and monitoring. Key additions include workspace dependencies for moka
, prometheus
, and uuid
to support these features. Advanced functionalities for reading, indexing, and caching data in the inverted index are implemented. Enhanced caching mechanisms aim to reduce redundant reads, while Prometheus metrics enable monitoring of cache statistics. Refinements in existing modules ensure smooth integration of these functionalities.
File Groupings | Change Summaries |
---|---|
src/index/Cargo.toml |
Added dependencies: moka , prometheus , and uuid . |
src/index/src/inverted_index.rs |
Introduced a new metrics module. |
src/index/src/inverted_index/format/reader.rs |
Added read_all , seek_read methods; renamed metadata method; adjusted fst and bitmap methods. |
src/index/src/inverted_index/format/reader/blob.rs |
Updated InvertedIndexBlobReader with new methods and logic for reading data. |
src/index/src/inverted_index/format/reader/cache.rs |
Implemented caching mechanisms via CachedInvertedIndexBlobReader and InvertedIndexCache . |
src/index/src/inverted_index/format/writer/blob.rs |
Modified fst and bitmap function calls to include offset and size parameters. |
src/index/src/inverted_index/metrics.rs |
Introduced Prometheus metrics for cache tracking via INDEX_CACHE_STATS . |
src/index/src/inverted_index/search/fst_values_mapper.rs |
Adjusted base offset calculation and closure arguments in the bitmap method. |
src/index/src/inverted_index/search/index_apply/predicates_apply.rs |
Updated IndexApplier implementation for FST offset and size handling. |
src/mito2/src/cache.rs |
Added index_cache field and methods in CacheManager ; initialized InvertedIndexCache . |
src/mito2/src/read/scan_region.rs |
Introduced index_cache variable in ScanRegion . |
src/mito2/src/sst/file.rs |
Added impl From<FileId> for Uuid . |
src/mito2/src/sst/index/applier.rs |
Added index_cache field in SstIndexApplier ; updated apply method. |
src/mito2/src/sst/index/applier/builder.rs |
Enhanced SstIndexApplierBuilder to include index_cache field and parameter. |
Multiple src/mito2/src/sst/index/applier/builder/* Files |
Added None parameter in test function calls. |
src/mito2/src/sst/index/creator.rs |
Loaded InvertedIndexCache and passed as an argument in tests. |
src/puffin/Cargo.toml |
Updated async-compression dependency with futures-io and zstd features. |
sequenceDiagram
participant Client
participant CacheManager
participant InvertedIndexCache
participant Metrics
Client->>CacheManager: Initialize Index Cache
CacheManager->>InvertedIndexCache: Create Cache Instance
CacheManager->>Metrics: Register Cache Metrics
Client->>CacheManager: Request Data
CacheManager->>InvertedIndexCache: Check Cache for Data
alt Data in Cache
InvertedIndexCache->>CacheManager: Return Data
CacheManager->>Client: Deliver Cached Data
else Data not in Cache
InvertedIndexCache->>CacheManager: Indicate Cache Miss
CacheManager->>Client: Fetch Data from Source
CacheManager->>InvertedIndexCache: Store Data in Cache
end
Metrics->>Client: Provide Cache Metrics
sequenceDiagram
participant Prometheus
participant Metrics
participant Client
Prometheus->>Metrics: Request Cache Metrics
Metrics->>Client: Generate Cache Stats
Client->>Metrics: Report Cache Stats
Metrics->>Prometheus: Send Cache Statistics
In the fields of code where rabbits delight,
New caches bloom, metrics in sight.
Withmoka
,prometheus
, anduuid
in tow,
Our project leaps with a performance glow.
No more redundant reads, we cheer,
Bytes saved, the future's clear!
Hopping fast and coding dear.
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
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 review
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?
Add iverted index cache
Checklist
Summary by CodeRabbit
New Features
Enhancements
InvertedIndexReader
andInvertedIndexBlobReader
with new methods for better data handling.CacheManager
to include inverted index caching.SstIndexApplier
to use cached index data conditionally.Dependency Updates
moka
,prometheus
, anduuid
as workspace dependencies.async-compression
to include "futures-io" and "zstd" features.