You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ya...@apache.org on 2021/04/30 02:11:51 UTC
[incubator-doris] branch master updated: [Config]Add uri param to
demonstrate tablet meta content of byte type for debug (#5693)
This is an automated email from the ASF dual-hosted git repository.
yangzhg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 3de4299 [Config]Add uri param to demonstrate tablet meta content of byte type for debug (#5693)
3de4299 is described below
commit 3de42999e03e553a1883c7dec6529675378d4054
Author: xinghuayu007 <14...@qq.com>
AuthorDate: Fri Apr 30 10:11:35 2021 +0800
[Config]Add uri param to demonstrate tablet meta content of byte type for debug (#5693)
* add switch to demonstrate tablet meta of byte type for debug
Co-authored-by: wangxixu <wa...@xiaomi.com>
---
be/src/http/action/meta_action.cpp | 9 ++++++++-
be/src/olap/olap_define.h | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/be/src/http/action/meta_action.cpp b/be/src/http/action/meta_action.cpp
index 8935c39..945c747 100644
--- a/be/src/http/action/meta_action.cpp
+++ b/be/src/http/action/meta_action.cpp
@@ -42,14 +42,20 @@ Status MetaAction::_handle_header(HttpRequest* req, std::string* json_meta) {
req->add_output_header(HttpHeaders::CONTENT_TYPE, HEADER_JSON.c_str());
std::string req_tablet_id = req->param(TABLET_ID_KEY);
std::string req_schema_hash = req->param(TABLET_SCHEMA_HASH_KEY);
+ std::string req_enable_base64 = req->param(ENABLE_BYTE_TO_BASE64);
uint64_t tablet_id = 0;
uint32_t schema_hash = 0;
+ bool enable_byte_to_base64 = false;
+ if (std::strcmp(req_enable_base64.c_str(), "true") == 0) {
+ enable_byte_to_base64 = true;
+ }
try {
tablet_id = std::stoull(req_tablet_id);
schema_hash = std::stoul(req_schema_hash);
} catch (const std::exception& e) {
LOG(WARNING) << "invalid argument.tablet_id:" << req_tablet_id
- << ", schema_hash:" << req_schema_hash;
+ << ", schema_hash:" << req_schema_hash
+ << ", enable_byte_to_base64: " << req_enable_base64;
return Status::InternalError(strings::Substitute("convert failed, $0", e.what()));
}
@@ -63,6 +69,7 @@ Status MetaAction::_handle_header(HttpRequest* req, std::string* json_meta) {
tablet->generate_tablet_meta_copy(tablet_meta);
json2pb::Pb2JsonOptions json_options;
json_options.pretty_json = true;
+ json_options.bytes_to_base64 = enable_byte_to_base64;
tablet_meta->to_json(json_meta, json_options);
return Status::OK();
}
diff --git a/be/src/olap/olap_define.h b/be/src/olap/olap_define.h
index ef1ec2e..2d828d4 100644
--- a/be/src/olap/olap_define.h
+++ b/be/src/olap/olap_define.h
@@ -391,6 +391,7 @@ static const std::string CONVERTED_FLAG = "true";
static const std::string TABLET_CONVERT_FINISHED = "tablet_convert_finished";
const std::string TABLET_ID_KEY = "tablet_id";
const std::string TABLET_SCHEMA_HASH_KEY = "schema_hash";
+const std::string ENABLE_BYTE_TO_BASE64 = "byte_to_base64";
const std::string TABLET_ID_PREFIX = "t_";
const std::string ROWSET_ID_PREFIX = "s_";
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org