-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Be refactor optimize meta tool new #1337
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
Be refactor optimize meta tool new #1337
Conversation
be/src/tools/meta_tool.cpp
Outdated
| root_path = path_prefix + root_path_postfix; | ||
| void load_meta(DataDir *data_dir) { | ||
| // load json tablet meta into meta | ||
| OLAPStatus s = TabletMetaManager::load_json_header(data_dir, FLAGS_json_meta_path); |
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.
load_json_meta
be/src/tools/meta_tool.cpp
Outdated
| } | ||
| void get_meta(DataDir *data_dir) { | ||
| std::string value; | ||
| OLAPStatus s = TabletMetaManager::get_json_header(data_dir, FLAGS_tablet_id, FLAGS_schema_hash, &value); |
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.
get_json_meta
be/src/tools/meta_tool.cpp
Outdated
| doris::TabletMetaPB tablet_meta_pb; | ||
| tablet_meta.to_meta_pb(&tablet_meta_pb); | ||
| json2pb::ProtoMessageToJson(tablet_meta_pb, &json_meta, json_options); | ||
| std::cout << "tablet meta:" << std::endl; |
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.
this line is not necessary.
be/src/olap/tablet_meta_manager.cpp
Outdated
| tablet_meta_pb.SerializeToString(&meta_binary); | ||
| TTabletId tablet_id = tablet_meta_pb.tablet_id(); | ||
| TSchemaHash schema_hash = tablet_meta_pb.schema_hash(); | ||
| std::cout << "start to save meta" << std::endl; |
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.
redundant line
|
|
||
| int main(int argc, char** argv) { | ||
| google::ParseCommandLineFlags(&argc, &argv, true); | ||
| void show_meta() { |
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 case need show_meta?
It seems that hdr exist?
be/src/tools/meta_tool.cpp
Outdated
| std::cout << "./meta_tool --operation=delete_header --tablet_id=tabletid --schema_hash=schemahash" << std::endl; | ||
| std::cout << "./meta_tool --root_path=rootpath --operation=rollback" << std::endl; | ||
| std::cout << "./meta_tool --operation=show_header --pb_header_path=path" << std::endl; | ||
| std::string get_usage(std::string progname) { |
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.
const std::string&
No description provided.