@@ -142,9 +142,9 @@ std::string nodes[] = {
142142 std::string (" item\t 45\t 0.21" ), std::string (" item\t 145\t 0.21" ),
143143 std::string (" item\t 112\t 0.21" ), std::string (" item\t 48\t 0.21" ),
144144 std::string (" item\t 247\t 0.21" ), std::string (" item\t 111\t 0.21" ),
145- std::string (" item\t 45 \t 0.21" ), std::string (" item\t 145 \t 0.21" ),
146- std::string (" item\t 122\t 0.21" ), std::string (" item\t 48 \t 0.21" ),
147- std::string (" item\t 247 \t 0.21" ), std::string (" item\t 111 \t 0.21" )};
145+ std::string (" item\t 46 \t 0.21" ), std::string (" item\t 146 \t 0.21" ),
146+ std::string (" item\t 122\t 0.21" ), std::string (" item\t 49 \t 0.21" ),
147+ std::string (" item\t 248 \t 0.21" ), std::string (" item\t 113 \t 0.21" )};
148148char node_file_name[] = " nodes.txt" ;
149149
150150void prepare_file (char file_name[], bool load_edge) {
@@ -373,6 +373,7 @@ void RunBrpcPushSparse() {
373373 // client2.load_edge_file(std::string("user2item"), std::string(file_name),
374374 // 0);
375375 nodes.clear ();
376+
376377 nodes = client1.pull_graph_list (std::string (" user" ), 0 , 1 , 4 , 1 );
377378
378379 for (auto g : nodes) {
@@ -381,6 +382,27 @@ void RunBrpcPushSparse() {
381382 std::cout << " node_ids: " << nodes[0 ].get_id () << std::endl;
382383 ASSERT_EQ (nodes[0 ].get_id (), 59 );
383384 nodes.clear ();
385+
386+ // Test Pull by step
387+
388+
389+ std::unordered_set<uint64_t > count_item_nodes;
390+ // pull by step 2
391+ for (int test_step=1 ; test_step < 4 ; test_step ++) {
392+ count_item_nodes.clear ();
393+ std::cout << " check pull graph list by step " << test_step << std::endl;
394+ for (int server_id = 0 ; server_id < 2 ; server_id ++) {
395+ for (int start_step = 0 ; start_step < test_step; start_step ++) {
396+ nodes = client1.pull_graph_list (std::string (" item" ), server_id, start_step, 12 , test_step);
397+ for (auto g : nodes) {
398+ count_item_nodes.insert (g.get_id ());
399+ }
400+ nodes.clear ();
401+ }
402+ }
403+ ASSERT_EQ (count_item_nodes.size (), 12 );
404+ }
405+
384406 vs = client1.batch_sample_neighboors (std::string (" user2item" ),
385407 std::vector<uint64_t >(1 , 96 ), 4 );
386408 ASSERT_EQ (vs[0 ].size (), 3 );
0 commit comments