MCPcopy Create free account
hub / github.com/alibaba/graph-learn / TestGetNodes

Function TestGetNodes

graphlearn/src/service/test/client_test.cpp:49–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void TestGetNodes(Client* client) {
50 for (int32_t epoch = 0; epoch < 3; ++epoch) {
51 for (int32_t iter = 0; iter < 10; ++iter) {
52 GetNodesRequest req("user", "by_order", NodeFrom::kNode, 64, epoch);
53 GetNodesResponse res;
54 Status s = client->GetNodes(&req, &res);
55 std::cout << "GetNodes: " << s.ToString() << std::endl;
56
57 if (!s.ok()) {
58 std::cout << "OutOfRange, epoch:" << epoch << std::endl;
59 break;
60 }
61 const int64_t* node_ids = res.NodeIds();
62 int32_t size = res.Size();
63 std::cout << "Size: " << size << std::endl;
64 for (int32_t i = 0; i < size; ++i) {
65 std::cout << node_ids[i] << std::endl;
66 }
67 }
68 }
69}
70
71void TestLookupNodes(Client* client) {
72 LookupNodesRequest req("movie");

Callers 1

mainFunction · 0.70

Calls 4

ToStringMethod · 0.45
okMethod · 0.45
NodeIdsMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected