-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
engine_trait: introduce status error #13059
Conversation
This PR is the first step to prepare for tirocks, the new rocksdb wrapper. The status error is introduced and iterator trait is refactored to keep consistent with tirocks. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
9c121a1
to
3bea3c9
Compare
/// A macro that will transform a rocksdb error to engine trait error. | ||
/// | ||
/// r stands for rocksdb, e stands for engine_trait. | ||
macro_rules! r2e { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we implement From
for error and avoid using macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because neither types are defined by engine_rocks
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about adding intermediate type in engine_rocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the type needs to be constructed every where. You can't build up such connections that just using ?
to convert two foreign types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about shortening from_rocksdb_error
to r2e
. Writing xxx().map_err(r2e)
is more readible than r2e!(xxx())
/// A macro that will transform a rocksdb error to engine trait error. | ||
/// | ||
/// r stands for rocksdb, e stands for engine_trait. | ||
macro_rules! r2e { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about rocks2engine_error so it's no need to see the definition to understand what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is too long to be written everywhere.
/// A trait that will transform a engine trait error to rocksdb error. | ||
/// | ||
/// r stands for rocksdb, e stands for engine_trait. | ||
macro_rules! e2r { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, engine2rocks_error?
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
@BusyJay: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 6a07901
|
/test |
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
…duce-status Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
/merge |
@BusyJay: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 3ece129
|
@BusyJay: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
…duce-status Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
/merge |
@BusyJay: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 294a558
|
ref tikv#13058 This PR is the first step to prepare for tirocks, the new rocksdb wrapper. The status error is introduced and iterator trait is refactored to keep consistent with tirocks. Signed-off-by: Jay Lee <BusyJayLee@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Co-authored-by: Xinye Tao <xy.tao@outlook.com>
What is changed and how it works?
Issue Number: Ref #13058
What's Changed:
Check List
Tests
Release note