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

Function TestGetEdges

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

Source from the content-addressed store, hash-verified

20using namespace graphlearn;
21
22void TestGetEdges(Client* client) {
23 for (int32_t epoch = 0; epoch < 3; ++epoch) {
24 for (int32_t iter = 0; iter < 100; ++iter) {
25 GetEdgesRequest req("click", "by_order", 64, epoch);
26 GetEdgesResponse res;
27 Status s = client->GetEdges(&req, &res);
28 std::cout << "GetEdges: " << s.ToString() << std::endl;
29
30 if (!s.ok()) {
31 std::cout << "OutOfRange, epoch:" << epoch << std::endl;
32 break;
33 }
34
35 const int64_t* src_ids = res.SrcIds();
36 const int64_t* dst_ids = res.DstIds();
37 const int64_t* edge_ids = res.EdgeIds();
38 int32_t size = res.Size();
39 std::cout << "Size: " << size << std::endl;
40 if (epoch == 0 && iter == 0) {
41 for (int32_t i = 0; i < size; ++i) {
42 std::cout << src_ids[i] << ", " << dst_ids[i] << ", " << edge_ids[i] << std::endl;
43 }
44 }
45 }
46 }
47}
48
49void TestGetNodes(Client* client) {
50 for (int32_t epoch = 0; epoch < 3; ++epoch) {

Callers 1

mainFunction · 0.70

Calls 6

SrcIdsMethod · 0.80
DstIdsMethod · 0.80
ToStringMethod · 0.45
okMethod · 0.45
EdgeIdsMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected