morningman commented on a change in pull request #3641:
URL: https://github.com/apache/incubator-doris/pull/3641#discussion_r428471970
##########
File path: be/src/tools/meta_tool.cpp
##########
@@ -122,13 +126,131 @@ void delete_meta(DataDir* data_dir) {
std::cout << "delete meta successfully" << std::endl;
}
+Status init_data_dir(const std::string dir, DataDir** ret) {
+ std::string root_path;
+ Status st = FileUtils::canonicalize(dir, &root_path);
+ if (!st.ok()) {
+ std::cout << "invalid root path:" << FLAGS_root_path
+ << ", error: " << st.to_string() << std::endl;
+ return Status::InternalError("invalid root path");
+ }
+ doris::StorePath path;
+ auto res = parse_root_path(root_path, &path);
+ if (res != OLAP_SUCCESS) {
+ std::cout << "parse root path failed:" << root_path << std::endl;
+ return Status::InternalError("parse root path failed");
+ }
+
+ *ret = new (std::nothrow) DataDir(path.path, path.capacity_bytes,
path.storage_medium);
+ if (*ret == nullptr) {
+ std::cout << "new data dir failed" << std::endl;
+ return Status::InternalError("new data dir failed");
+ }
+ st = (*ret)->init();
+ if (!st.ok()) {
+ std::cout << "data_dir load failed" << std::endl;
+ return Status::InternalError("data_dir load failed");
+ }
+
+ return Status::OK();
+}
+
+void batch_delete_meta(const std::string tablet_file) {
Review comment:
OK
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]