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: remove DB generic #806

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

bsbds
Copy link
Collaborator

@bsbds bsbds commented May 9, 2024

Please briefly answer these questions:

  • what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)

    The DB generic is redundant as no other type will ever implement StorageApi in Xline. This change aims to enhance readability of the codebase.

  • what changes does this pull request make?

  • are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)

@mergify mergify bot requested a review from a team May 9, 2024 07:31
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 86.32479% with 16 lines in your changes missing coverage. Please review.

Project coverage is 75.70%. Comparing base (e35b35a) to head (d836804).
Report is 117 commits behind head on master.

Files Patch % Lines
crates/xline/src/server/command.rs 64.70% 3 Missing and 3 partials ⚠️
crates/xline/src/server/maintenance.rs 62.50% 1 Missing and 5 partials ⚠️
crates/xline/src/server/xline_server.rs 89.65% 0 Missing and 3 partials ⚠️
crates/xline/src/storage/db.rs 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #806      +/-   ##
==========================================
+ Coverage   75.55%   75.70%   +0.15%     
==========================================
  Files         180      187       +7     
  Lines       26938    27822     +884     
  Branches    26938    27822     +884     
==========================================
+ Hits        20353    21063     +710     
- Misses       5366     5470     +104     
- Partials     1219     1289      +70     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bsbds bsbds marked this pull request as ready for review May 9, 2024 09:49
@kamyuentse
Copy link

Though xline currently has only one StorageApi impl,the generic is make sense for the community if someone want to use another storage engine.

@bsbds
Copy link
Collaborator Author

bsbds commented May 14, 2024

Though xline currently has only one StorageApi impl,the generic is make sense for the community if someone want to use another storage engine.

The engine crate already provides a level of abstraction, I think introducing the StorageApi would be redundant.

@mergify mergify bot requested a review from a team May 16, 2024 07:39
@mergify mergify bot requested a review from a team May 16, 2024 07:39
Copy link
Collaborator

@rogercloud rogercloud left a comment

Choose a reason for hiding this comment

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

If we remove the DB generic here, is it necessary to keep StorageApi trait?

crates/xline/src/storage/compact/mod.rs Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team June 9, 2024 02:47
@bsbds bsbds force-pushed the remove-db-generic branch from 754ab79 to f5d5087 Compare June 11, 2024 01:25
@bsbds
Copy link
Collaborator Author

bsbds commented Jun 11, 2024

If we remove the DB generic here, is it necessary to keep StorageApi trait?

removed

Copy link
Collaborator

@Phoenix500526 Phoenix500526 left a comment

Choose a reason for hiding this comment

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

LGTM. Please squash these commits into one commit

@mergify mergify bot requested a review from a team June 17, 2024 02:16
@bsbds bsbds force-pushed the remove-db-generic branch from 94788f3 to d836804 Compare June 17, 2024 02:20
Copy link
Contributor

@CrystalAnalyst CrystalAnalyst left a comment

Choose a reason for hiding this comment

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

LGTM.

@mergify mergify bot merged commit b495721 into xline-kv:master Jun 20, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants