-
Notifications
You must be signed in to change notification settings - Fork 472
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
util: Add WriteBatchInspector to inspect WriteBatch #1069
Conversation
After inpecting hook, I think |
cool, the batch looks correct, it may be caused by the uninitialized value. Can have a look at #1068 |
Ok, the handler is pasted from rocksdb's |
@mapleFU I think we can keep this PR, coz it can make the batch debug easier. |
a650885
to
a1ea781
Compare
@git-hulk update and making it as a tool |
@git-hulk I think it's ready to be merged now |
OK, will take a look soon. |
#include <string> | ||
#include <vector> | ||
|
||
/// Usage: |
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.
Should we write some notes to explain why the file was introduced and what the motivation was. Otherwise other developers might wonder what the file was for.
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.
Updated now
fe7699a
to
37fce1b
Compare
I noticed that |
A sample is https://github.com/facebook/rocksdb/blob/main/db/table_cache.h#L1-L8 |
@tanruixiang in our NOTICE file there is an entry about RocksDB dependency, and RocksDB supports downstream use under the Apache License 2.0 - so basically, it won't hurt. But we can improve the copyright info layout and add an original link here. @mapleFU if you'd like to, refer to: .. or I'll update it after this patch is merged. It's not a blocker, anyway. |
aa74aa9
@tisonkun updated, PTAL |
@mapleFU it seems that we don't use this Inspector in other code? That said, if you'd like to debug, you add the code snippet as documented? |
Yes, maybe user can receive raw bytes from remote and using this to parse the input @tisonkun |
Merging... |
Hi, here I add a tool for inspecting WriteBatch, and using it for debugging