[opensource] refine ob_admin to print clog without user data

This commit is contained in:
gjw2284740
2022-03-04 10:25:16 +08:00
committed by LINxiansheng
parent 60a0eee9d3
commit e7f1eb7a75
4 changed files with 49 additions and 18 deletions

View File

@ -220,7 +220,7 @@ int ObLogEntryParser::get_type_(ObCLogItemType& type)
return ret;
}
int ObLogEntryParser::dump_all_entry(bool is_hex)
int ObLogEntryParser::dump_all_entry(bool is_hex, bool without_data)
{
int ret = OB_SUCCESS;
if (OB_UNLIKELY(!is_inited_)) {
@ -228,6 +228,7 @@ int ObLogEntryParser::dump_all_entry(bool is_hex)
CLOG_LOG(ERROR, "log entry parser is not inited", K(is_inited_), K(ret));
} else {
dump_hex_ = is_hex;
without_data_ = without_data;
while (OB_SUCC(ret)) {
if (OB_FAIL(parse_next_entry())) {
if (OB_ITER_END != ret) {
@ -690,7 +691,9 @@ int ObLogEntryParserImpl::dump_memtable_mutator(const char* buf, int64_t len)
ret = OB_SUCCESS;
break;
} else {
if (dump_hex_) {
if (without_data_) {
fprintf(stdout, " MutatorRow={*} | OLD_ROW={");
} else if (dump_hex_) {
int64_t pos = row.rowkey_.to_smart_string(print_buf_, PRINT_BUF_SIZE - 1);
print_buf_[pos] = '\0';
fprintf(stdout, " MutatorRow={%s} HexedRowkey={%s} | OLD_ROW={", to_cstring(row), print_buf_);
@ -1444,7 +1447,9 @@ int ObLogEntryParserImpl::dump_freeze_log(const char* buf, const int64_t buf_len
int ObLogEntryParserImpl::dump_obj(const common::ObObj& obj, uint64_t column_id)
{
int ret = OB_SUCCESS;
if (dump_hex_) {
if (without_data_) {
fprintf(stdout, "*");
} else if (dump_hex_) {
int64_t buf_len = PRINT_BUF_SIZE - 1; // reserver one character for '\0'
int64_t pos = 0;
if (OB_UNLIKELY(!is_inited_)) {