remove unused code
This commit is contained in:
@ -25,7 +25,6 @@ libobcdc_unittest(test_ob_log_dlist)
|
||||
libobcdc_unittest(test_log_utils)
|
||||
libobcdc_unittest(test_ob_log_adapt_string)
|
||||
libobcdc_unittest(test_ob_concurrent_seq_queue)
|
||||
libobcdc_unittest(test_ob_seq_thread)
|
||||
libobcdc_unittest(test_ob_cdc_part_trans_resolver)
|
||||
libobcdc_unittest(test_log_svr_blacklist)
|
||||
libobcdc_unittest(test_ob_cdc_sorted_list)
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2021 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "ob_seq_thread.h"
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace common
|
||||
{
|
||||
class MyClass {};
|
||||
|
||||
class CThread : public ObSeqThread<256, MyClass>
|
||||
{
|
||||
public:
|
||||
CThread() {}
|
||||
virtual ~CThread() {}
|
||||
|
||||
public:
|
||||
virtual int handle(void *task, const int64_t task_seq, const int64_t thread_index, volatile bool &stop_flag)
|
||||
{
|
||||
if (! stop_flag) {
|
||||
EXPECT_EQ(task_seq + 1, (int64_t)task);
|
||||
}
|
||||
UNUSED(thread_index);
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
class TestSeqThread : public ::testing::Test
|
||||
{
|
||||
public:
|
||||
TestSeqThread() {}
|
||||
~TestSeqThread() {}
|
||||
|
||||
void SetUp() {}
|
||||
void TearDown() {}
|
||||
};
|
||||
|
||||
TEST_F(TestSeqThread, basic)
|
||||
{
|
||||
CThread thread;
|
||||
ObMemAttr attr(OB_SERVER_TENANT_ID, ObNewModIds::TEST);
|
||||
// Parameter not legal
|
||||
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(257, 100, attr));
|
||||
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(0, 0, attr));
|
||||
|
||||
EXPECT_EQ(OB_SUCCESS, thread.init(256, 10000, attr));
|
||||
EXPECT_EQ(OB_SUCCESS, thread.start());
|
||||
for (int64_t index = 0; index < 1000; index++) {
|
||||
EXPECT_EQ(OB_SUCCESS, thread.push((void*)(index + 1), index, 0));
|
||||
}
|
||||
sleep(1);
|
||||
thread.stop();
|
||||
EXPECT_EQ(true, thread.is_stoped());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
oceanbase::common::ObLogger::get_logger().set_log_level("INFO");
|
||||
OB_LOGGER.set_log_level("INFO");
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@ -15,7 +15,6 @@
|
||||
#include <gmock/gmock.h>
|
||||
#include "rootserver/ob_multi_cluster_manager.h"
|
||||
#include "share/ob_web_service_root_addr.h"
|
||||
#include "share/ob_cluster_info_proxy.h"
|
||||
#include "share/ob_multi_cluster_proxy.h"
|
||||
|
||||
namespace oceanbase {
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
#include "share/scheduler/ob_worker_obj_pool.h"
|
||||
#include "lib/atomic/ob_atomic.h"
|
||||
#include "observer/omt/ob_tenant_node_balancer.h"
|
||||
#include "share/scheduler/ob_dag_type.h"
|
||||
|
||||
int64_t dag_cnt = 1;
|
||||
int64_t stress_time= 5; // 500ms
|
||||
|
||||
@ -445,7 +445,7 @@ private:
|
||||
ObSchema &tmp_schema = const_cast<ObSchema &>(schema);
|
||||
ObSchemaCacheValue tmp_cache_value(schema_type, &tmp_schema);
|
||||
int64_t deep_copy_size = tmp_cache_value.size();
|
||||
char *tmp_ptr = (char *)ob_malloc(deep_copy_size, ObModIds::OB_SCHEMA_CACHE_SYS_CACHE_VALUE);
|
||||
char *tmp_ptr = (char *)ob_malloc(deep_copy_size, "ScheCacSysCacVa");
|
||||
ObIKVCacheValue *kv_cache_value = NULL;
|
||||
if (NULL == tmp_ptr) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
|
||||
#define USING_LOG_PREFIX SHARE
|
||||
#include "lib/stat/ob_session_stat.h"
|
||||
#include "share/ob_cluster_info_proxy.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "schema/db_initializer.h"
|
||||
|
||||
|
||||
@ -441,7 +441,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
common::reset_mem_leak_checker_label(ObModIds::OB_COMMON_ARRAY_OB_LOG_TABLE_SCAN);
|
||||
common::reset_mem_leak_checker_label("ComArrObLogTabS");
|
||||
::test::init_pc();
|
||||
::test::run_test();
|
||||
return 0;
|
||||
|
||||
@ -223,7 +223,7 @@ void TestSqlUtils::init()
|
||||
} else if (OB_FAIL(exec_ctx_.create_physical_plan_ctx())) {
|
||||
OB_LOG(WARN, "Create plan ctx error", K(ret));
|
||||
ASSERT_TRUE(0);
|
||||
} else if (OB_SUCCESS != (ret = next_user_table_id_map_.create(16, ObModIds::OB_HASH_BUCKET_ALTER_TABLE_MAP ))) {
|
||||
} else if (OB_SUCCESS != (ret = next_user_table_id_map_.create(16, "HashBucAltTabMa"))) {
|
||||
_OB_LOG(WARN, "create user table id map failed, ret=%ld", ret);
|
||||
ASSERT_TRUE(0);
|
||||
} else {
|
||||
|
||||
@ -29,7 +29,7 @@ ObMockIterator::ObMockIterator(bool reverse)
|
||||
cursor_(0),
|
||||
reverse_(reverse),
|
||||
trans_id_(888),
|
||||
allocator_(ObModIds::OB_ST_TEMP)
|
||||
allocator_("StTemp")
|
||||
{
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ int ObMockIterator::from(const ObString &str, char escape, uint16_t *col_id_arra
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObMockIteratorBuilder builder;
|
||||
ObArenaAllocator buffer(ObModIds::OB_ST_TEMP);
|
||||
ObArenaAllocator buffer("StTemp");
|
||||
if (OB_SUCCESS != (ret != builder.init(&buffer, escape))) {
|
||||
STORAGE_LOG(WARN, "init builder failed");
|
||||
} else {
|
||||
|
||||
@ -95,7 +95,7 @@ int TestHashMapPerformance::prepare_hash_map(const int64_t count, const double l
|
||||
if (hash_map_.created()) {
|
||||
hash_map_.destroy();
|
||||
}
|
||||
if (OB_FAIL(hash_map_.create(bucket_num, common::ObModIds::TEST_SERVICE, common::ObModIds::TEST_SERVICE))) {
|
||||
if (OB_FAIL(hash_map_.create(bucket_num, "TestService", "TestService"))) {
|
||||
STORAGE_LOG(WARN, "fail to create hash map", K(ret));
|
||||
}
|
||||
return ret;
|
||||
@ -107,7 +107,7 @@ int TestHashMapPerformance::prepare_array_hash_map(const int64_t count, const do
|
||||
const double bucket_num_tmp = load_factor * static_cast<double>(count);
|
||||
const int64_t bucket_num = static_cast<int64_t>(bucket_num_tmp);
|
||||
STORAGE_LOG(INFO, "array hash map bucket num", K(bucket_num));
|
||||
if (OB_FAIL(array_hash_map_.init(common::ObModIds::TICKET_QUEUE, bucket_num))) {
|
||||
if (OB_FAIL(array_hash_map_.init("TicketQueue", bucket_num))) {
|
||||
STORAGE_LOG(WARN, "fail to create hash map", K(ret));
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -32,7 +32,7 @@ const static int64_t DEF_COL_NUM = 4;
|
||||
void check_row_fuse(const char *input, const char *expect)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
//const ObStoreRow *expect_row = NULL;
|
||||
const ObStoreRow *input_row = NULL;
|
||||
ObStoreRow *result = NULL;
|
||||
@ -77,7 +77,7 @@ void check_row_fuse(const char *input, const char *expect)
|
||||
void check_simple_row_fuse(const char *input, const char *expect)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
//const ObStoreRow *expect_row = NULL;
|
||||
const ObStoreRow *input_row = NULL;
|
||||
ObStoreRow *result = NULL;
|
||||
@ -231,7 +231,7 @@ TEST(ObRowFuseTest, test_fuse_empty)
|
||||
|
||||
TEST(ObRowFuseTest, test_invalid_input_row)
|
||||
{
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
char *input_ptr = (char *)allocator.alloc(OB_ROW_MAX_COLUMNS_COUNT * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
char *result_ptr = (char *)allocator.alloc(OB_ROW_MAX_COLUMNS_COUNT * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
ObStoreRow *input_row = new (input_ptr) ObStoreRow;
|
||||
@ -255,7 +255,7 @@ TEST(ObRowFuseTest, test_invalid_input_row)
|
||||
|
||||
TEST(ObRowFuseTest, test_invalid_argument)
|
||||
{
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
char *input_ptr = (char *)allocator.alloc(DEF_COL_NUM * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
char *result_ptr = (char *)allocator.alloc(DEF_COL_NUM * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
ObStoreRow *input_row = new (input_ptr) ObStoreRow;
|
||||
@ -279,7 +279,7 @@ TEST(ObRowFuseTest, test_invalid_argument)
|
||||
|
||||
TEST(ObRowFuseTest, test_err_unexpected)
|
||||
{
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
char *input_ptr = (char *)allocator.alloc(DEF_COL_NUM * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
char *result_ptr = (char *)allocator.alloc(DEF_COL_NUM * sizeof(ObObj) + sizeof(ObStoreRow));
|
||||
ObStoreRow *input_row = new (input_ptr) ObStoreRow;
|
||||
@ -301,7 +301,7 @@ TEST(ObRowFuseTest, test_err_unexpected)
|
||||
TEST(ObRowFuseTest, test_nop_pos)
|
||||
{
|
||||
ObNopPos nop_pos;
|
||||
common::ObArenaAllocator allocator(ObModIds::OB_ST_TEMP);
|
||||
common::ObArenaAllocator allocator("StTemp");
|
||||
// ASSERT_EQ(OB_ALLOCATE_MEMORY_FAILED, nop_pos.init(LONG_MAX));
|
||||
ASSERT_EQ(OB_SUCCESS, nop_pos.init(allocator, 256));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user