Skip to content
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): Define Version and metadata builders for mito2 #1989

Merged
merged 10 commits into from
Jul 19, 2023

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Jul 18, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR defines the following structs to hold region metadata in memory:

  • Version
  • VersionControl
  • MemtableVersion
  • SstVersion (replaces the old LevelMetas)
  • LevelMeta
  • FileMeta
  • FileHandle
  • FileId

It also implements some builders to build structs like RegionMetadata. The builder use validate() method defined in ColumnMetadata and RegionMetadata to check whether the struct is valid.

It also checks whether a column in the Schema is unique.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

@evenyag evenyag marked this pull request as ready for review July 18, 2023 11:52
@evenyag evenyag self-assigned this Jul 18, 2023
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #1989 (e1594a9) into develop (43bde82) will decrease coverage by 0.40%.
The diff coverage is 79.51%.

@@             Coverage Diff             @@
##           develop    #1989      +/-   ##
===========================================
- Coverage    85.77%   85.38%   -0.40%     
===========================================
  Files          639      642       +3     
  Lines       102727   103143     +416     
===========================================
- Hits         88116    88067      -49     
- Misses       14611    15076     +465     

@evenyag evenyag requested review from v0y4g3r and waynexia July 19, 2023 05:03
Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/datatypes/src/error.rs Show resolved Hide resolved
@v0y4g3r v0y4g3r enabled auto-merge July 19, 2023 07:44
src/mito2/src/sst/version.rs Show resolved Hide resolved
@v0y4g3r v0y4g3r added this pull request to the merge queue Jul 19, 2023
Merged via the queue into GreptimeTeam:develop with commit bb84684 Jul 19, 2023
@evenyag evenyag deleted the feat/mito2-version-control branch July 19, 2023 12:46
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
…eam#1989)

* feat: define structs for version

* feat: Build region from metadata and memtable builder

* feat: impl validate for metadata

* feat: add more fields to RegionMetadata

* test: more tests

* test: more check and test

* feat: allow overwriting version

* style: fix clippy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants