-
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
storage: simple refactoring #5822
Conversation
@@ -21,18 +21,22 @@ use std::io::Error as IoError; | |||
use std::sync::{atomic, Arc}; | |||
use std::{cmp, error, u64}; | |||
|
|||
use engine::{IterOption, DATA_KEY_PREFIX_LEN}; | |||
use engine::{ |
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.
I saw it in the import formatting:
Group imports from the same logical project together (i.e., imports from different crates in the same project).
Group imports from external crates together; do not separate std imports from other crates.
engine
crate is a component in TiKV. futures
is an external crate. kvproto
is a part of TiKV but in a different GitHub repo. Should we group them together?
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.
Oh, do you think they all belong to external crates? Only crate::..
is from the same logical project.
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.
I've been thinking about it since I was doing this PR :-) I think I will change that advice somewhat, it is complicated.
The grouping I;ve used here is to put the imports then the re-exports and group by std, external crates (including workspace crates), then the current crate
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,great job
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.
Rest LGTM.
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.
Mostly LGTM. I like it that it breaks down some very-large files.
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
@youjiali1995 @MyonKeminta rebased and comments addressed. Please take another look |
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
Oh, something wrong in CI. Please fix the CI. |
Signed-off-by: Nick Cameron <nrc@ncameron.org>
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
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
/run-all-tests |
Signed-off-by: Nick Cameron <nrc@ncameron.org>
What have you changed?
These are mostly simple code motion refactorings to split up a few big files and get rid of some
utils
modules.What is the type of the changes?
Pick one of the following and delete the others:
PTAL @breeswish @youjiali1995 (I recommend reviewing each commit, they standalone and each is quite simple by itself)