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

refactor: change value of meta-service key DatabaseNameIdent from DatabaseId to Id<DatabaseId> #16299

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Aug 21, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

refactor: change value of meta-service key DatabaseNameIdent from DatabaseId to Id<DatabaseId>

Id<DatabaseId> is a prost::Message and can be used directly as a
meta-service value thus it unifies get operation to meta-service.
For example, KVPbApi::get_db() now can be used to get a u64 id value,
instead of using get_u64_value().

refactor: make Id more generic so that it can include any kind of Id type

This will be useful to make Id<T> a wrapper type for T to impl
prost::Message for T.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Refactoring

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Aug 21, 2024
@drmingdrmer drmingdrmer marked this pull request as ready for review August 21, 2024 07:16
@drmingdrmer drmingdrmer force-pushed the 113-id-wrapper branch 4 times, most recently from 2fbb094 to 8841f9a Compare August 22, 2024 03:10
…type

This will be useful to make `Id<T>` a wrapper type for T to impl
`prost::Message` for T.
…DatabaseId` to `Id<DatabaseId>`

`Id<DatabaseId>` is a `prost::Message` and can be used directly as a
meta-service value thus it unifies get operation to meta-service.
For example, `KVPbApi::get_db()` now can be used to get a u64 id value,
instead of using `get_u64_value()`.
@drmingdrmer drmingdrmer merged commit 152589f into databendlabs:main Aug 22, 2024
69 checks passed
@drmingdrmer drmingdrmer deleted the 113-id-wrapper branch August 22, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant