提交 fd0fb243 编写于 作者: S simonjoylet 提交者: LINGuanRen

fix compile and dump sstable_meta of ob_admin

上级 a22496d9
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "share/backup/ob_tenant_name_mgr.h" #include "share/backup/ob_tenant_name_mgr.h"
#include "storage/blocksstable/ob_block_sstable_struct.h" #include "storage/blocksstable/ob_block_sstable_struct.h"
#include "storage/blocksstable/ob_macro_block_meta_mgr.h"
#include "storage/blocksstable/ob_store_file.h" #include "storage/blocksstable/ob_store_file.h"
#include "storage/ob_i_table.h" #include "storage/ob_i_table.h"
#include "observer/ob_server_struct.h" #include "observer/ob_server_struct.h"
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include "storage/blocksstable/ob_store_file.h" #include "storage/blocksstable/ob_store_file.h"
#include "storage/ob_partition_service.h" #include "storage/ob_partition_service.h"
#include "storage/ob_table_mgr.h" #include "storage/ob_table_mgr.h"
#include "storage/ob_table_mgr_meta_block_reader.h"
#include "storage/ob_sstable.h" #include "storage/ob_sstable.h"
#include "storage/blocksstable/ob_macro_meta_block_reader.h"
#include "storage/ob_tenant_config_mgr.h" #include "storage/ob_tenant_config_mgr.h"
#include "storage/ob_tenant_config_meta_block_reader.h" #include "storage/ob_tenant_config_meta_block_reader.h"
#include "storage/blocksstable/ob_micro_block_scanner.h" #include "storage/blocksstable/ob_micro_block_scanner.h"
...@@ -358,66 +356,58 @@ int ObAdminDumpsstExecutor::open_store_file() ...@@ -358,66 +356,58 @@ int ObAdminDumpsstExecutor::open_store_file()
void ObAdminDumpsstExecutor::print_macro_meta() void ObAdminDumpsstExecutor::print_macro_meta()
{ {
// int ret = OB_SUCCESS; // int ret = OB_SUCCESS;
const ObMacroBlockMeta *meta = NULL; const ObMacroBlockMeta *meta = NULL;
ObMacroBlockMetaHandle meta_handle;
MacroBlockId macro_id(dump_macro_context_.macro_id_); MacroBlockId macro_id(dump_macro_context_.macro_id_);
/*if (OB_FAIL(ObMacroBlockMetaMgr::get_instance().get_meta(macro_id, meta_handle))) { PrintHelper::print_dump_title("Macro Meta");
STORAGE_LOG(ERROR, "failed to get meta", K(ret)); PrintHelper::print_dump_line("macro_block_id", dump_macro_context_.macro_id_);
} else if (OB_ISNULL(meta = meta_handle.get_meta())) { PrintHelper::print_dump_line("attr", meta->attr_);
ret = OB_ERR_UNEXPECTED; PrintHelper::print_dump_line("data_version", meta->data_version_);
STORAGE_LOG(ERROR, "meta is null", K(ret)); PrintHelper::print_dump_line("column_number", meta->column_number_);
} else {*/ PrintHelper::print_dump_line("rowkey_column_number", meta->rowkey_column_number_);
PrintHelper::print_dump_title("Macro Meta"); PrintHelper::print_dump_line("column_index_scale", meta->column_index_scale_);
PrintHelper::print_dump_line("macro_block_id", dump_macro_context_.macro_id_); PrintHelper::print_dump_line("row_store_type", meta->row_store_type_);
PrintHelper::print_dump_line("attr", meta->attr_); PrintHelper::print_dump_line("row_count", meta->row_count_);
PrintHelper::print_dump_line("data_version", meta->data_version_); PrintHelper::print_dump_line("occupy_size", meta->occupy_size_);
PrintHelper::print_dump_line("column_number", meta->column_number_); PrintHelper::print_dump_line("data_checksum", meta->data_checksum_);
PrintHelper::print_dump_line("rowkey_column_number", meta->rowkey_column_number_); PrintHelper::print_dump_line("micro_block_count", meta->micro_block_count_);
PrintHelper::print_dump_line("column_index_scale", meta->column_index_scale_); PrintHelper::print_dump_line("micro_block_data_offset", meta->micro_block_data_offset_);
PrintHelper::print_dump_line("row_store_type", meta->row_store_type_); PrintHelper::print_dump_line("micro_block_index_offset", meta->micro_block_index_offset_);
PrintHelper::print_dump_line("row_count", meta->row_count_); PrintHelper::print_dump_line("micro_block_endkey_offset", meta->micro_block_endkey_offset_);
PrintHelper::print_dump_line("occupy_size", meta->occupy_size_); PrintHelper::print_dump_line("compressor", meta->compressor_);
PrintHelper::print_dump_line("data_checksum", meta->data_checksum_); PrintHelper::print_dump_line("table_id", meta->table_id_);
PrintHelper::print_dump_line("micro_block_count", meta->micro_block_count_); PrintHelper::print_dump_line("data_seq", meta->data_seq_);
PrintHelper::print_dump_line("micro_block_data_offset", meta->micro_block_data_offset_); PrintHelper::print_dump_line("schema_version", meta->schema_version_);
PrintHelper::print_dump_line("micro_block_index_offset", meta->micro_block_index_offset_); PrintHelper::print_dump_line("snapshot_version", meta->snapshot_version_);
PrintHelper::print_dump_line("micro_block_endkey_offset", meta->micro_block_endkey_offset_); PrintHelper::print_dump_line("schema_rowkey_col_cnt", meta->schema_rowkey_col_cnt_);
PrintHelper::print_dump_line("compressor", meta->compressor_); PrintHelper::print_dump_line("row_count_delta", meta->row_count_delta_);
PrintHelper::print_dump_line("table_id", meta->table_id_); PrintHelper::print_dump_line("macro_block_deletion_flag", meta->macro_block_deletion_flag_);
PrintHelper::print_dump_line("data_seq", meta->data_seq_); PrintHelper::print_dump_list_start("column_id_array");
PrintHelper::print_dump_line("schema_version", meta->schema_version_); for (int64_t i = 0; i < meta->column_number_; ++i) {
PrintHelper::print_dump_line("snapshot_version", meta->snapshot_version_); PrintHelper::print_dump_list_value(meta->column_id_array_[i], i == meta->rowkey_column_number_ - 1);
PrintHelper::print_dump_line("schema_rowkey_col_cnt", meta->schema_rowkey_col_cnt_); }
PrintHelper::print_dump_line("row_count_delta", meta->row_count_delta_); PrintHelper::print_dump_list_end();
PrintHelper::print_dump_line("macro_block_deletion_flag", meta->macro_block_deletion_flag_); PrintHelper::print_dump_list_start("column_type_array");
PrintHelper::print_dump_list_start("column_id_array"); for (int64_t i = 0; i < meta->column_number_; ++i) {
for (int64_t i = 0; i < meta->column_number_; ++i) { PrintHelper::print_dump_list_value(to_cstring(meta->column_type_array_[i]), i == meta->rowkey_column_number_ - 1);
PrintHelper::print_dump_list_value(meta->column_id_array_[i], i == meta->rowkey_column_number_ - 1); }
} PrintHelper::print_dump_list_end();
PrintHelper::print_dump_list_end(); PrintHelper::print_dump_list_start("column_checksum");
PrintHelper::print_dump_list_start("column_type_array"); for (int64_t i = 0; i < meta->column_number_; ++i) {
for (int64_t i = 0; i < meta->column_number_; ++i) { PrintHelper::print_dump_list_value(meta->column_checksum_[i], i== meta->rowkey_column_number_ - 1);
PrintHelper::print_dump_list_value(to_cstring(meta->column_type_array_[i]), i == meta->rowkey_column_number_ - 1); }
} PrintHelper::print_dump_list_end();
PrintHelper::print_dump_list_end(); PrintHelper::print_dump_list_start("end_key");
PrintHelper::print_dump_list_start("column_checksum"); for (int64_t i = 0; i < meta->rowkey_column_number_; ++i) {
for (int64_t i = 0; i < meta->column_number_; ++i) { PrintHelper::print_cell(meta->endkey_[i], in_csv_);
PrintHelper::print_dump_list_value(meta->column_checksum_[i], i== meta->rowkey_column_number_ - 1); }
} PrintHelper::print_dump_list_end();
PrintHelper::print_dump_list_end(); PrintHelper::print_dump_list_start("column_order");
PrintHelper::print_dump_list_start("end_key"); for (int64_t i = 0; i < meta->column_number_; ++i) {
for (int64_t i = 0; i < meta->rowkey_column_number_; ++i) { PrintHelper::print_dump_list_value(meta->column_order_array_[i], i == meta->column_number_ - 1);
PrintHelper::print_cell(meta->endkey_[i], in_csv_); }
} PrintHelper::print_dump_list_end();
PrintHelper::print_dump_list_end(); PrintHelper::print_end_line();
PrintHelper::print_dump_list_start("column_order");
for (int64_t i = 0; i < meta->column_number_; ++i) {
PrintHelper::print_dump_list_value(meta->column_order_array_[i], i == meta->column_number_ - 1);
}
PrintHelper::print_dump_list_end();
PrintHelper::print_end_line();
//}
} }
void ObAdminDumpsstExecutor::dump_sstable() void ObAdminDumpsstExecutor::dump_sstable()
...@@ -456,12 +446,9 @@ void ObAdminDumpsstExecutor::dump_sstable() ...@@ -456,12 +446,9 @@ void ObAdminDumpsstExecutor::dump_sstable()
void ObAdminDumpsstExecutor::dump_sstable_meta() void ObAdminDumpsstExecutor::dump_sstable_meta()
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
ObTableHandle handle;
ObSSTable *sstable = NULL; ObSSTable *sstable = NULL;
if (OB_FAIL(ObPartitionService::get_instance().acquire_sstable(table_key_, handle))) { if (OB_FAIL(replay_slog_to_get_sstable(sstable))) {
STORAGE_LOG(ERROR, "fail to acquire table", K(ret), K(table_key_)); STORAGE_LOG(ERROR, "fail to acquire table", K(ret), K(table_key_));
} else if (OB_FAIL(handle.get_sstable(sstable))) {
STORAGE_LOG(ERROR, "fail to get sstable", K(ret));
} else if (OB_ISNULL(sstable)) { } else if (OB_ISNULL(sstable)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(WARN, "error unexpected, sstable must not be NULL", K(ret)); STORAGE_LOG(WARN, "error unexpected, sstable must not be NULL", K(ret));
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "lib/container/ob_array.h" #include "lib/container/ob_array.h"
#include "share/config/ob_config_manager.h" #include "share/config/ob_config_manager.h"
#include "storage/blocksstable/ob_block_sstable_struct.h" #include "storage/blocksstable/ob_block_sstable_struct.h"
#include "storage/blocksstable/ob_macro_block_meta_mgr.h"
#include "storage/blocksstable/ob_store_file.h" #include "storage/blocksstable/ob_store_file.h"
#include "storage/ob_i_table.h" #include "storage/ob_i_table.h"
#include "observer/ob_server_struct.h" #include "observer/ob_server_struct.h"
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#define USING_LOG_PREFIX COMMON #define USING_LOG_PREFIX COMMON
#include "ob_admin_slog_executor.h" #include "ob_admin_slog_executor.h"
#include "storage/blocksstable/slog/ob_base_storage_logger.h" #include "storage/blocksstable/slog/ob_base_storage_logger.h"
#include "storage/blocksstable/ob_macro_block_meta_mgr.h"
#include "storage/ob_partition_service.h" #include "storage/ob_partition_service.h"
#include "storage/ob_table_mgr.h" #include "storage/ob_table_mgr.h"
#include "storage/ob_tenant_config_mgr.h" #include "storage/ob_tenant_config_mgr.h"
...@@ -49,9 +48,6 @@ int ObAdminSlogExecutor::execute(int argc, char *argv[]) ...@@ -49,9 +48,6 @@ int ObAdminSlogExecutor::execute(int argc, char *argv[])
if (NULL != log_dir_ && log_file_id_ > 0) { if (NULL != log_dir_ && log_file_id_ > 0) {
if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_PARTITION, &partition_module))) { if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_PARTITION, &partition_module))) {
LOG_WARN("fail to register partition module", K(ret)); LOG_WARN("fail to register partition module", K(ret));
} else if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_MACROBLOCK,
&ObMacroBlockMetaMgr::get_instance()))) {
LOG_WARN("fail to register macro module", K(ret));
} else if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_TABLE_MGR, } else if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_TABLE_MGR,
&ObTableMgr::get_instance()))) { &ObTableMgr::get_instance()))) {
LOG_WARN("fail to register table module", K(ret)); LOG_WARN("fail to register table module", K(ret));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册