-
Notifications
You must be signed in to change notification settings - Fork 309
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
feat(mito): make use of options in RegionCreate/OpenRequest #2436
feat(mito): make use of options in RegionCreate/OpenRequest #2436
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2436 +/- ##
===========================================
+ Coverage 77.63% 77.68% +0.04%
===========================================
Files 729 731 +2
Lines 115114 116089 +975
===========================================
+ Hits 89374 90189 +815
- Misses 25740 25900 +160 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serde master
…Team#2436) * refactor: move RegionOptions to options mod * refactor: define compaction strategy in region/options.rs * feat: use duration for time window * refactor: rename CompactionStrategy to CompactionOptions * feat: use serde to parse options * feat: parse options * feat: set options on creation/opening * test: test create/open with options * chore: remove todo * feat: get compaction ttl and options from RegionOptions * style: fix clippy * chore: Remove unused engine_options * style: fix clippy * chore: remove todo
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
This PR stores
RegionOptions
fromRegionCreateRequest
andRegionOpenRequest
inVersion
. Now we can get the options users specify while creating/opening the region.Since
RegionCreateRequest
andRegionOpenRequest
useHashMap<String, String>
to transfer options, this PR serializes the map to a JSON string and deserializes it to theRegionOptions
struct. Due to the limitation of serde, we still need to special handle nested structs.This avoid writing lots of
get()
andparse()
like this:greptimedb/src/store-api/src/storage/engine.rs
Lines 160 to 194 in 342cc0a
Refactor
CompactionStrategy
toCompactionOptions
Duration
to store compaction time windowRegionOptions
tooptions.rs
engine_options
Checklist
Refer to a related PR or issue link (optional)