patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -20,14 +20,15 @@ using namespace oceanbase;
using namespace oceanbase::common;
using namespace oceanbase::share;
TEST(ObMemstoreAllocatorMgr, funcs)
{
const uint64_t PRESERVED_TENANT_COUNT = 10000;
common::ObMemstoreAllocatorMgr& alloc_mgr = common::ObMemstoreAllocatorMgr::get_instance();
common::ObMemstoreAllocatorMgr &alloc_mgr = common::ObMemstoreAllocatorMgr::get_instance();
int ret = alloc_mgr.init();
EXPECT_EQ(OB_SUCCESS, ret);
common::ObGMemstoreAllocator* allocator = NULL;
common::ObGMemstoreAllocator *allocator = NULL;
ret = alloc_mgr.get_tenant_memstore_allocator(0, allocator);
EXPECT_EQ(OB_INVALID_ARGUMENT, ret);
@ -48,17 +49,18 @@ TEST(ObMemstoreAllocatorMgr, funcs)
ret = alloc_mgr.get_tenant_memstore_allocator(OB_SYS_TENANT_ID + PRESERVED_TENANT_COUNT, allocator);
EXPECT_EQ(OB_SUCCESS, ret);
EXPECT_NE((void*)NULL, allocator);
}
int init_tenant_mgr()
{
ObTenantManager& tm = ObTenantManager::get_instance();
ObTenantManager &tm = ObTenantManager::get_instance();
/*
ObAddr self;
self.set_ip_addr("127.0.0.1", 8086);
rpc::frame::ObReqTransport req_transport(NULL, NULL);
obrpc::ObSrvRpcProxy rpc_proxy;*/
// int ret = tm.init(self, rpc_proxy, &req_transport, &ObServerConfig::get_instance());
//int ret = tm.init(self, rpc_proxy, &req_transport, &ObServerConfig::get_instance());
int ret = tm.init();
EXPECT_EQ(OB_SUCCESS, ret);
ret = tm.add_tenant(OB_SYS_TENANT_ID);
@ -67,7 +69,7 @@ int init_tenant_mgr()
const int64_t llmt = 8LL << 30;
ret = tm.set_tenant_mem_limit(OB_SYS_TENANT_ID, ulmt, llmt);
EXPECT_EQ(OB_SUCCESS, ret);
common::ObMemstoreAllocatorMgr& mem_mgr = common::ObMemstoreAllocatorMgr::get_instance();
common::ObMemstoreAllocatorMgr &mem_mgr = common::ObMemstoreAllocatorMgr::get_instance();
ret = mem_mgr.init();
EXPECT_EQ(OB_SUCCESS, ret);
return ret;
@ -75,9 +77,9 @@ int init_tenant_mgr()
int main(int argc, char** argv)
{
// init_tenant_mgr();
//init_tenant_mgr();
oceanbase::common::ObLogger::get_logger().set_log_level("INFO");
OB_LOGGER.set_log_level("INFO");
testing::InitGoogleTest(&argc, argv);
testing::InitGoogleTest(&argc,argv);
return RUN_ALL_TESTS();
}