GehaFearless commented on code in PR #1658:
URL: 
https://github.com/apache/incubator-pegasus/pull/1658#discussion_r1474347681


##########
src/meta/test/cluster_balance_policy_test.cpp:
##########
@@ -180,48 +177,49 @@ TEST(cluster_balance_policy, get_node_migration_info)
     all_apps[appid] = app;
 
     node_state ns;
-    ns.set_addr(address);
+    ns.set_hp(address);
     gpid pid = gpid(appid, 0);
     ns.put_partition(pid, true);
 
     cluster_balance_policy::node_migration_info migration_info;
     policy.get_node_migration_info(ns, all_apps, migration_info);
 
-    ASSERT_EQ(migration_info.address, address);
+    ASSERT_EQ(migration_info.hp, address);
     ASSERT_NE(migration_info.partitions.find(disk_tag), 
migration_info.partitions.end());
     ASSERT_EQ(migration_info.partitions.at(disk_tag).size(), 1);
     ASSERT_EQ(*migration_info.partitions.at(disk_tag).begin(), pid);
 }
 
 TEST(cluster_balance_policy, get_min_max_set)
 {
-    std::map<rpc_address, uint32_t> node_count_map;
-    node_count_map.emplace(rpc_address(1, 10086), 1);
-    node_count_map.emplace(rpc_address(2, 10086), 3);
-    node_count_map.emplace(rpc_address(3, 10086), 5);
-    node_count_map.emplace(rpc_address(4, 10086), 5);
+    std::map<host_port, uint32_t> node_count_map;
+    node_count_map.emplace(host_port("localhost", 10081), 1);
+    node_count_map.emplace(host_port("localhost", 10082), 3);
+    node_count_map.emplace(host_port("localhost", 10083), 5);
+    node_count_map.emplace(host_port("localhost", 10084), 5);
 
-    std::set<rpc_address> min_set, max_set;
+    std::set<host_port> min_set, max_set;
     get_min_max_set(node_count_map, min_set, max_set);
 
     ASSERT_EQ(min_set.size(), 1);
-    ASSERT_EQ(*min_set.begin(), rpc_address(1, 10086));
+    ASSERT_EQ(*min_set.begin(), host_port("localhost", 10081));
     ASSERT_EQ(max_set.size(), 2);
-    ASSERT_EQ(*max_set.begin(), rpc_address(3, 10086));
-    ASSERT_EQ(*max_set.rbegin(), rpc_address(4, 10086));
+    ASSERT_EQ(*max_set.begin(), host_port("localhost", 10083));
+    ASSERT_EQ(*max_set.rbegin(), host_port("localhost", 10084));
 }
 
 TEST(cluster_balance_policy, get_disk_partitions_map)
 {
-    cluster_balance_policy policy(nullptr);
+    meta_service svc;
+    cluster_balance_policy policy(&svc);
     cluster_balance_policy::cluster_migration_info cluster_info;
-    rpc_address addr(1, 10086);
+    host_port addr("localhost", 10086);

Review Comment:
   addr -> hp



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to