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: access KVMeta with methods instead of field #14013

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Dec 14, 2023

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

Summary

refactor: access KVMeta with methods instead of field

Make KVMeta.expire_at a private field for future refactoring.
Update accessing to it with via methods.

Several methods are added to KVMeta and SeqValue:

  • eval_expire_at_ms() evaluate and return a absolute expire time in millisecond. The returned value is set to u64::MAX if not expire is set.
  • get_expire_at_ms() return an Option of absolute expire time in millisecond.

Changelog

  • Improvement

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 Dec 14, 2023
Make `KVMeta.expire_at` a private field for future refactoring.
Update accessing to it with via methods.

Several methods are added to `KVMeta` and `SeqValue`:

- `eval_expire_at_ms()` evaluate and return a absolute expire time in millisecond. The returned value is set to `u64::MAX` if not expire is set.
- `get_expire_at_ms()` return an `Option` of absolute expire time in millisecond.
@drmingdrmer drmingdrmer marked this pull request as ready for review December 14, 2023 07:10
@drmingdrmer drmingdrmer added this pull request to the merge queue Dec 14, 2023
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Nice change!

@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Dec 14, 2023
@BohuTANG BohuTANG merged commit b650f83 into databendlabs:main Dec 14, 2023
70 checks passed
@drmingdrmer drmingdrmer deleted the 39-expire-at branch December 14, 2023 08:09
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.

4 participants