Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 14, 2023
1 parent 5943e64 commit 3a4627a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
7 changes: 3 additions & 4 deletions src/test/function_test/base_api/integration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST_F(integration_test, write_corrupt_db)
// cause timeout.
// Force to fetch the latest route table.
client_ =
pegasus_client_factory::get_client(kClusterName_.c_str(), table_name_.c_str());
pegasus_client_factory::get_client(kClusterName.c_str(), table_name_.c_str());
ASSERT_TRUE(client_ != nullptr);
} else {
ASSERT_TRUE(false) << ret;
Expand All @@ -86,8 +86,7 @@ TEST_F(integration_test, write_corrupt_db)
break;
}
ASSERT_EQ(PERR_NOT_FOUND, ret);
client_ =
pegasus_client_factory::get_client(kClusterName_.c_str(), table_name_.c_str());
client_ = pegasus_client_factory::get_client(kClusterName.c_str(), table_name_.c_str());
ASSERT_TRUE(client_ != nullptr);

ret = client_->get(hkey, skey, got_value);
Expand Down Expand Up @@ -180,7 +179,7 @@ TEST_F(integration_test, read_corrupt_db)
// a new read operation on the primary replica it ever held will cause timeout.
// Force to fetch the latest route table.
client_ =
pegasus_client_factory::get_client(kClusterName_.c_str(), table_name_.c_str());
pegasus_client_factory::get_client(kClusterName.c_str(), table_name_.c_str());
ASSERT_TRUE(client_ != nullptr);
} else {
ASSERT_TRUE(false) << ret;
Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/base_api/test_batch_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class batch_get : public test_util
TEST_F(batch_get, set_and_then_batch_get)
{
auto rrdb_client =
new ::dsn::apps::rrdb_client(kClusterName_.c_str(), meta_list_, table_name_.c_str());
new ::dsn::apps::rrdb_client(kClusterName.c_str(), meta_list_, table_name_.c_str());

int test_data_count = 100;
int test_timeout_milliseconds = 3000;
Expand Down
4 changes: 2 additions & 2 deletions src/test/function_test/base_api/test_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class copy_data_test : public test_util
ddl_client_->create_app(
destination_app_name, "pegasus", default_partitions, 3, {}, false));
source_client_ =
pegasus_client_factory::get_client(kClusterName_.c_str(), source_app_name.c_str());
pegasus_client_factory::get_client(kClusterName.c_str(), source_app_name.c_str());
ASSERT_NE(nullptr, source_client_);
destination_client_ =
pegasus_client_factory::get_client(kClusterName_.c_str(), destination_app_name.c_str());
pegasus_client_factory::get_client(kClusterName.c_str(), destination_app_name.c_str());
ASSERT_NE(nullptr, destination_client_);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/base_api/test_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class scan_test : public test_util
test_util::SetUp();
ASSERT_EQ(dsn::ERR_OK, ddl_client_->drop_app(table_name_, 0));
ASSERT_EQ(dsn::ERR_OK, ddl_client_->create_app(table_name_, "pegasus", 8, 3, {}, false));
client_ = pegasus_client_factory::get_client(kClusterName_.c_str(), table_name_.c_str());
client_ = pegasus_client_factory::get_client(kClusterName.c_str(), table_name_.c_str());
ASSERT_TRUE(client_ != nullptr);
ASSERT_NO_FATAL_FAILURE(fill_database());
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/function_test/bulk_load/test_bulk_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class bulk_load_test : public test_util
global_env::instance()._pegasus_root,
kLocalServiceRoot,
kBulkLoad,
kClusterName_,
kClusterName,
table_name_);
}

Expand Down Expand Up @@ -244,7 +244,7 @@ class bulk_load_test : public test_util
error_code start_bulk_load(bool ingest_behind)
{
return ddl_client_
->start_bulk_load(table_name_, kClusterName_, "local_service", kBulkLoad, ingest_behind)
->start_bulk_load(table_name_, kClusterName, "local_service", kBulkLoad, ingest_behind)
.get_value()
.err;
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/function_test/restore/test_restore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class restore_test : public test_util
{
test_util::SetUp();

backup_path_ = fmt::format("onebox/block_service/local_service/{}", kClusterName_);
backup_path_ = fmt::format("onebox/block_service/local_service/{}", kClusterName);

NO_FATALS(write_data(kTestCount));

Expand All @@ -79,7 +79,7 @@ class restore_test : public test_util
std::this_thread::sleep_for(std::chrono::seconds(30));
ASSERT_EQ(ERR_OK,
ddl_client_->do_restore("local_service",
kClusterName_,
kClusterName,
/* policy_name */ "",
first_backup_timestamp_,
table_name_,
Expand Down
8 changes: 4 additions & 4 deletions src/test/function_test/utils/test_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test_util::test_util(map<string, string> create_envs)
{test_util::OperateDataType::kGet, "get"},
{test_util::OperateDataType::kDelete, "delete"},
{test_util::OperateDataType::kCheckNotFound, "check not found"}}),
kClusterName_("onebox"),
kClusterName("onebox"),
kDefaultHashkeyPrefix("hashkey_"),
kDefaultSortkey("sortkey"),
kDefaultValuePrefix("value_"),
Expand All @@ -83,7 +83,7 @@ void test_util::SetUpTestCase() { ASSERT_TRUE(pegasus_client_factory::initialize
void test_util::SetUp()
{
ASSERT_TRUE(replica_helper::load_meta_servers(
meta_list_, PEGASUS_CLUSTER_SECTION_NAME.c_str(), kClusterName_.c_str()));
meta_list_, PEGASUS_CLUSTER_SECTION_NAME.c_str(), kClusterName.c_str()));
ASSERT_FALSE(meta_list_.empty());

ddl_client_ = std::make_shared<replication_ddl_client>(meta_list_);
Expand All @@ -100,7 +100,7 @@ void test_util::SetUp()
} else {
ASSERT_EQ(dsn::ERR_OK, ret);
}
client_ = pegasus_client_factory::get_client(kClusterName_.c_str(), table_name_.c_str());
client_ = pegasus_client_factory::get_client(kClusterName.c_str(), table_name_.c_str());
ASSERT_TRUE(client_ != nullptr);

int32_t partition_count;
Expand Down Expand Up @@ -185,7 +185,7 @@ void test_util::operate_data(OperateDataType type,
int count) const
{
fmt::print(stdout, "start to {} {} key-value pairs...\n", kOpNames.at(type), count);
auto *client = pegasus_client_factory::get_client(kClusterName_.c_str(), table_name.c_str());
auto *client = pegasus_client_factory::get_client(kClusterName.c_str(), table_name.c_str());
ASSERT_NE(client, nullptr);
int64_t start = dsn_now_ms();
ASSERT_GT(count, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/utils/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class test_util : public ::testing::Test
const std::optional<std::string> &value_prefix,
int count) const;

const std::string kClusterName_;
const std::string kClusterName;
const std::string kDefaultHashkeyPrefix;
const std::string kDefaultSortkey;
const std::string kDefaultValuePrefix;
Expand Down

0 comments on commit 3a4627a

Please sign in to comment.