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 storage::kv to reduce abstraction duplication #9480
Comments
Some obvious followups:
Any kv engine abstractions within tikv should depend only on engine_traits. |
It might be easier to start by moving btree_engine and mock_engine into their own crates. |
This module uses very few other tikv modules, so once it is sufficiently cleaned up and minimized, it may be able to live in its own crate, maybe |
Signed-off-by: Brian Anderson <andersrb@gmail.com> <!-- Thank you for contributing to TiKV! If you haven't already, please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, module3]: what's changed 2. *: what's changed If you want to open the **Challenge Program** pull request, please use the following template: https://raw.githubusercontent.com/tikv/.github/master/.github/PULL_REQUEST_TEMPLATE/challenge-program.md You can use it with query parameters: https://github.com/tikv/tikv/compare/master...${you branch}?template=challenge-program.md --> ### What problem does this PR solve? Cleaning up the tikv::storage::kv module to make it eventually generic over engine_traits - cc #9480 - cc #6402 ### What is changed and how it works? This code is unused. Delete it. ### Related changes ### Check List <!--REMOVE the items that are not applicable--> ### Release note <!-- bugfixes or new feature need a release note --> - No release note.
This module contains its own traits that define the properties of a key-value store. These traits mostly duplicate engine_traits, while also introducing a few other capabilities, while also leaking details of rocksdb. I'm finding this module to be troublesome as I look for more opportunities to remove rocksdb-specifics from the tikv crate, and think it could use some cleanup.
I propose changing this module to mostly reuse the traits from engine_traits, adding new methods directly to engine_traits where it makes sense, and leaving other methods as extensions traits where those methods don't belong in engine_traits.
Specifically:
*Ext
traits in engine_traits to*EngineExt
to indicate these are extensions to the mainKvEngine
trait. This step is needed to make room for new*Ext
traits in the next step.kv::{Engine, Snapshot, Iterator}
toKvEngineExt
,SnapshotExt
etc.There's definitely more cleanup that can be done from there (like putting btree_engine into its own crate), but these steps are about as far ahead as I can see offhand. I think getting this done would go a long way toward simplifying the kvengine abstractions within the tikv crate.
cc #6402
The text was updated successfully, but these errors were encountered: