diff --git a/src/storage/tablet/ob_tablet.cpp b/src/storage/tablet/ob_tablet.cpp index df07c0177a..860c243cbf 100644 --- a/src/storage/tablet/ob_tablet.cpp +++ b/src/storage/tablet/ob_tablet.cpp @@ -6190,12 +6190,12 @@ int ObTablet::build_memtable(common::ObIArray &handle_array, co ObITable *table = nullptr; for (int64_t i = start_pos; OB_SUCC(ret) && i < handle_array.count(); ++i) { - memtable::ObMemtable *memtable = nullptr; + memtable::ObIMemtable *memtable = nullptr; table = handle_array.at(i).get_table(); if (OB_UNLIKELY(nullptr == table || !table->is_memtable())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table must be memtable", K(ret), K(i), KPC(table)); - } else if (FALSE_IT(memtable = reinterpret_cast(table))) { + } else if (FALSE_IT(memtable = static_cast(table))) { } else if (memtable->is_empty()) { FLOG_INFO("Empty memtable discarded", KPC(memtable)); } else if (OB_FAIL(add_memtable(memtable))) { @@ -6324,12 +6324,12 @@ int ObTablet::rebuild_memtable(common::ObIArray &handle_array) LOG_DEBUG("before rebuild memtable", K(memtable_count_), K(last_idx), KP(last_memtable), K(end_scn), K(handle_array)); for (int64_t i = 0; OB_SUCC(ret) && i < handle_array.count(); ++i) { - memtable::ObMemtable *memtable = nullptr; + memtable::ObIMemtable *memtable = nullptr; ObITable *table = handle_array.at(i).get_table(); if (OB_UNLIKELY(nullptr == table || !table->is_memtable())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table must be memtable", K(ret), K(i), KPC(table)); - } else if (FALSE_IT(memtable = static_cast(table))) { + } else if (FALSE_IT(memtable = static_cast(table))) { } else if (memtable->is_empty()) { FLOG_INFO("Empty memtable discarded", KPC(memtable)); } else if (table->get_end_scn() < end_scn) { @@ -6361,12 +6361,12 @@ int ObTablet::rebuild_memtable( } else { // use clog checkpoint scn to filter memtable handle array for (int64_t i = 0; OB_SUCC(ret) && i < handle_array.count(); ++i) { - memtable::ObMemtable *memtable = nullptr; + memtable::ObIMemtable *memtable = nullptr; ObITable *table = handle_array.at(i).get_table(); if (OB_UNLIKELY(nullptr == table || !table->is_memtable())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table must be memtable", K(ret), K(i), KPC(table)); - } else if (FALSE_IT(memtable = static_cast(table))) { + } else if (FALSE_IT(memtable = static_cast(table))) { } else if (memtable->is_empty()) { FLOG_INFO("Empty memtable discarded", K(ret), KPC(memtable)); } else if (table->get_end_scn() <= clog_checkpoint_scn) { @@ -6380,7 +6380,7 @@ int ObTablet::rebuild_memtable( return ret; } -int ObTablet::add_memtable(memtable::ObMemtable* const table) +int ObTablet::add_memtable(memtable::ObIMemtable* const table) { int ret = OB_SUCCESS; diff --git a/src/storage/tablet/ob_tablet.h b/src/storage/tablet/ob_tablet.h index 592bc4338f..fd645e14ee 100644 --- a/src/storage/tablet/ob_tablet.h +++ b/src/storage/tablet/ob_tablet.h @@ -811,7 +811,7 @@ private: int rebuild_memtable( const share::SCN &clog_checkpoint_scn, common::ObIArray &handle_array); - int add_memtable(memtable::ObMemtable* const table); + int add_memtable(memtable::ObIMemtable* const table); bool exist_memtable_with_end_scn(const ObITable *table, const share::SCN &end_scn); int assign_memtables(memtable::ObIMemtable * const *memtables, const int64_t memtable_count); int assign_ddl_kvs(ObDDLKV * const *ddl_kvs, const int64_t ddl_kv_count);