split ss_micro_cache_common_meta.h & remove some dependency on ob_rpc_struct.h

This commit is contained in:
obdev
2024-09-19 08:04:03 +00:00
committed by ob-robot
parent 317af38d97
commit 64b461ea63
4 changed files with 22 additions and 2 deletions

View File

@ -3560,13 +3560,30 @@ int ObGetSSMicroBlockMetaP::process()
} else {
MTL_SWITCH(arg_.tenant_id_) {
ObSSMicroCache *micro_cache = nullptr;
ObSSMicroBlockMetaHandle micro_meta_handle;
if (OB_ISNULL(micro_cache = MTL(ObSSMicroCache *))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("MTL ObSSMicroCache is null", KR(ret), K_(arg_.tenant_id));
} else if (OB_FAIL(micro_cache->get_micro_meta_info(arg_.micro_key_, result_.micro_meta_info_))) {
} else if (OB_FAIL(micro_cache->get_micro_meta_handle(arg_.micro_key_, micro_meta_handle))) {
if (OB_ENTRY_NOT_EXIST != ret) {
LOG_WARN("fail to get micro block meta", KR(ret), K_(arg));
}
} else if (OB_UNLIKELY(!micro_meta_handle.is_valid())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("micro_meta handle should be valid", KR(ret), K_(arg));
} else {
ObSSMicroMetaInfo &micro_meta_info = result_.micro_meta_info_;
micro_meta_info.reuse_version_ = micro_meta_handle()->reuse_version();
micro_meta_info.data_dest_ = micro_meta_handle()->data_dest();
micro_meta_info.access_time_ = micro_meta_handle()->access_time();
micro_meta_info.length_ = micro_meta_handle()->length();
micro_meta_info.is_in_l1_ = micro_meta_handle()->is_in_l1();
micro_meta_info.is_in_ghost_ = micro_meta_handle()->is_in_ghost();
micro_meta_info.is_persisted_ = micro_meta_handle()->is_persisted();
micro_meta_info.is_reorganizing_ = micro_meta_handle()->is_reorganizing();
micro_meta_info.ref_cnt_ = micro_meta_handle()->ref_cnt();
micro_meta_info.crc_ = micro_meta_handle()->crc();
micro_meta_info.micro_key_ = micro_meta_handle()->get_micro_key();
}
}
}

View File

@ -85,6 +85,7 @@
#include "share/ob_heartbeat_handler.h"
#ifdef OB_BUILD_SHARED_STORAGE
#include "storage/shared_storage/micro_cache/ob_ss_micro_cache_stat.h" // storage::ObSSMicroCacheStat
#include "storage/shared_storage/micro_cache/ob_ss_arc_info.h"
#endif
#include "storage/tablelock/ob_table_lock_common.h" //ObTableLockPriority

View File

@ -18,8 +18,9 @@
#include "lib/ob_errno.h"
#include "lib/allocator/ob_concurrent_fifo_allocator.h"
#include "lib/container/ob_array.h"
#include "storage/shared_storage/micro_cache/ob_ss_arc_info.h"
#include "storage/shared_storage/micro_cache/ob_ss_micro_cache_basic_op.h"
#include "storage/shared_storage/micro_cache/ob_ss_micro_cache_stat.h"
namespace oceanbase
{
namespace storage

View File

@ -12,6 +12,7 @@
#define USING_LOG_PREFIX STORAGE
#include "gtest/gtest.h"
#include <thread>
#define private public
#define protected public