diff --git a/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.h b/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.h index e40fa59626e0181a069038d60b6263b3a13a3634..1b370581a12981dee08764da7c6e5f9c9377ce2b 100644 --- a/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.h +++ b/tools/ob_admin/backup_tool/ob_admin_dump_backup_data_executor.h @@ -22,7 +22,6 @@ #include "share/backup/ob_tenant_name_mgr.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/ob_i_table.h" #include "observer/ob_server_struct.h" diff --git a/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.cpp b/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.cpp index 540199723bc5a654aa61bd61fca5755bc72292d5..754f5d5c402cca9a50f3b89320311270d143248e 100644 --- a/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.cpp +++ b/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.cpp @@ -15,9 +15,7 @@ #include "storage/blocksstable/ob_store_file.h" #include "storage/ob_partition_service.h" #include "storage/ob_table_mgr.h" -#include "storage/ob_table_mgr_meta_block_reader.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_meta_block_reader.h" #include "storage/blocksstable/ob_micro_block_scanner.h" @@ -358,66 +356,58 @@ int ObAdminDumpsstExecutor::open_store_file() void ObAdminDumpsstExecutor::print_macro_meta() { - // int ret = OB_SUCCESS; + // int ret = OB_SUCCESS; const ObMacroBlockMeta *meta = NULL; - ObMacroBlockMetaHandle meta_handle; MacroBlockId macro_id(dump_macro_context_.macro_id_); - /*if (OB_FAIL(ObMacroBlockMetaMgr::get_instance().get_meta(macro_id, meta_handle))) { - STORAGE_LOG(ERROR, "failed to get meta", K(ret)); - } else if (OB_ISNULL(meta = meta_handle.get_meta())) { - ret = OB_ERR_UNEXPECTED; - STORAGE_LOG(ERROR, "meta is null", K(ret)); - } else {*/ - PrintHelper::print_dump_title("Macro Meta"); - PrintHelper::print_dump_line("macro_block_id", dump_macro_context_.macro_id_); - PrintHelper::print_dump_line("attr", meta->attr_); - PrintHelper::print_dump_line("data_version", meta->data_version_); - PrintHelper::print_dump_line("column_number", meta->column_number_); - PrintHelper::print_dump_line("rowkey_column_number", meta->rowkey_column_number_); - PrintHelper::print_dump_line("column_index_scale", meta->column_index_scale_); - PrintHelper::print_dump_line("row_store_type", meta->row_store_type_); - PrintHelper::print_dump_line("row_count", meta->row_count_); - PrintHelper::print_dump_line("occupy_size", meta->occupy_size_); - PrintHelper::print_dump_line("data_checksum", meta->data_checksum_); - PrintHelper::print_dump_line("micro_block_count", meta->micro_block_count_); - PrintHelper::print_dump_line("micro_block_data_offset", meta->micro_block_data_offset_); - PrintHelper::print_dump_line("micro_block_index_offset", meta->micro_block_index_offset_); - PrintHelper::print_dump_line("micro_block_endkey_offset", meta->micro_block_endkey_offset_); - PrintHelper::print_dump_line("compressor", meta->compressor_); - PrintHelper::print_dump_line("table_id", meta->table_id_); - PrintHelper::print_dump_line("data_seq", meta->data_seq_); - PrintHelper::print_dump_line("schema_version", meta->schema_version_); - PrintHelper::print_dump_line("snapshot_version", meta->snapshot_version_); - 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_line("macro_block_deletion_flag", meta->macro_block_deletion_flag_); - PrintHelper::print_dump_list_start("column_id_array"); - for (int64_t i = 0; i < meta->column_number_; ++i) { - 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_start("column_type_array"); - 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_end(); - PrintHelper::print_dump_list_start("column_checksum"); - 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_end(); - PrintHelper::print_dump_list_start("end_key"); - for (int64_t i = 0; i < meta->rowkey_column_number_; ++i) { - PrintHelper::print_cell(meta->endkey_[i], in_csv_); - } - PrintHelper::print_dump_list_end(); - 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(); - //} + PrintHelper::print_dump_title("Macro Meta"); + PrintHelper::print_dump_line("macro_block_id", dump_macro_context_.macro_id_); + PrintHelper::print_dump_line("attr", meta->attr_); + PrintHelper::print_dump_line("data_version", meta->data_version_); + PrintHelper::print_dump_line("column_number", meta->column_number_); + PrintHelper::print_dump_line("rowkey_column_number", meta->rowkey_column_number_); + PrintHelper::print_dump_line("column_index_scale", meta->column_index_scale_); + PrintHelper::print_dump_line("row_store_type", meta->row_store_type_); + PrintHelper::print_dump_line("row_count", meta->row_count_); + PrintHelper::print_dump_line("occupy_size", meta->occupy_size_); + PrintHelper::print_dump_line("data_checksum", meta->data_checksum_); + PrintHelper::print_dump_line("micro_block_count", meta->micro_block_count_); + PrintHelper::print_dump_line("micro_block_data_offset", meta->micro_block_data_offset_); + PrintHelper::print_dump_line("micro_block_index_offset", meta->micro_block_index_offset_); + PrintHelper::print_dump_line("micro_block_endkey_offset", meta->micro_block_endkey_offset_); + PrintHelper::print_dump_line("compressor", meta->compressor_); + PrintHelper::print_dump_line("table_id", meta->table_id_); + PrintHelper::print_dump_line("data_seq", meta->data_seq_); + PrintHelper::print_dump_line("schema_version", meta->schema_version_); + PrintHelper::print_dump_line("snapshot_version", meta->snapshot_version_); + 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_line("macro_block_deletion_flag", meta->macro_block_deletion_flag_); + PrintHelper::print_dump_list_start("column_id_array"); + for (int64_t i = 0; i < meta->column_number_; ++i) { + 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_start("column_type_array"); + 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_end(); + PrintHelper::print_dump_list_start("column_checksum"); + 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_end(); + PrintHelper::print_dump_list_start("end_key"); + for (int64_t i = 0; i < meta->rowkey_column_number_; ++i) { + PrintHelper::print_cell(meta->endkey_[i], in_csv_); + } + PrintHelper::print_dump_list_end(); + 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() @@ -456,12 +446,9 @@ void ObAdminDumpsstExecutor::dump_sstable() void ObAdminDumpsstExecutor::dump_sstable_meta() { int ret = OB_SUCCESS; - ObTableHandle handle; 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_)); - } else if (OB_FAIL(handle.get_sstable(sstable))) { - STORAGE_LOG(ERROR, "fail to get sstable", K(ret)); } else if (OB_ISNULL(sstable)) { ret = OB_ERR_UNEXPECTED; STORAGE_LOG(WARN, "error unexpected, sstable must not be NULL", K(ret)); diff --git a/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.h b/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.h index 95dcb6e7d240d3a520d77ebd034541bcdd0163e8..08de3129f6e164a3cf92cf09c60ccb11a59af564 100644 --- a/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.h +++ b/tools/ob_admin/dumpsst/ob_admin_dumpsst_executor.h @@ -16,7 +16,6 @@ #include "lib/container/ob_array.h" #include "share/config/ob_config_manager.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/ob_i_table.h" #include "observer/ob_server_struct.h" diff --git a/tools/ob_admin/slog_tool/ob_admin_slog_executor.cpp b/tools/ob_admin/slog_tool/ob_admin_slog_executor.cpp index 6eba0e5acb342390dd3d1e9bba202d7b44bbe069..59f104e7511bbbe457fb2131cc6a86e52619cb7f 100644 --- a/tools/ob_admin/slog_tool/ob_admin_slog_executor.cpp +++ b/tools/ob_admin/slog_tool/ob_admin_slog_executor.cpp @@ -13,7 +13,6 @@ #define USING_LOG_PREFIX COMMON #include "ob_admin_slog_executor.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_table_mgr.h" #include "storage/ob_tenant_config_mgr.h" @@ -49,9 +48,6 @@ int ObAdminSlogExecutor::execute(int argc, char *argv[]) if (NULL != log_dir_ && log_file_id_ > 0) { if (OB_FAIL(SLOGGER.register_redo_module(OB_REDO_LOG_PARTITION, &partition_module))) { 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, &ObTableMgr::get_instance()))) { LOG_WARN("fail to register table module", K(ret));