-
Notifications
You must be signed in to change notification settings - Fork 92
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
Introduce file inspector and add FileSystemInspectedEnv #216
Conversation
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
include/rocksdb/env.h
Outdated
@@ -364,6 +364,8 @@ class Env { | |||
// Priority for requesting bytes in rate limiter scheduler | |||
enum IOPriority { IO_LOW = 0, IO_HIGH = 1, IO_TOTAL = 2 }; | |||
|
|||
enum IOType { IO_UNCATEGORIZED = 0, IO_FLUSH = 1, IO_COMPACTION = 2 }; |
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 want to avoid adding IO type to rocksdb code. I think the rust FileSystemInpector
can obtain the thread-local IO type by itself. To tell flush and compaction apart, we can set the thread-local IO type in the OnFlushBegin
/OnCompactionBegin
callbacks.
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.
Sounds great, save lots of trouble.
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.
@yiwu-arbug But I think OnCompactionBegin
doesn't respect subcompaction.
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.
sad. how about adding an sub-compaction begin event?
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.
Also OnFlushComplete
is tricky, it can run on another thread. But maybe we just make use of both of the Begin
event.
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.
It's doable, I'll leave it for followup PRs.
Signed-off-by: tabokie <xy.tao@outlook.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.
sorry for delay.
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Comments addressed. @yiwu-arbug @Connor1996 |
Signed-off-by: tabokie <xy.tao@outlook.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
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
Introduce `FileSystemInspector` interface and `FileSystemInspectedEnv`. With `FileSystemInspectedEnv`, each file operation must first consult `FileSystemInspector` before reaching actual IO logic. Signed-off-by: tabokie <xy.tao@outlook.com>
Introduce `FileSystemInspector` interface and `FileSystemInspectedEnv`. With `FileSystemInspectedEnv`, each file operation must first consult `FileSystemInspector` before reaching actual IO logic. Signed-off-by: tabokie <xy.tao@outlook.com>
Introduce
FileSystemInspector
abstract interface andFileSystemInspectedEnv
. WithFileSystemInspectedEnv
, each file operation must first consultFileSystemInspector
before reaching actual IO logic.Also, addIOType
support toSequentialFile
. Before compaction or flush, the specific type can be passed to inspector through newly added methods. Notice it might be possible to merge existingTableReaderCaller
with IOType, maybe as a followup task.