| 282 | } |
| 283 | |
| 284 | void TestTopkSampleNeighbors(Client* client) { |
| 285 | SamplingRequest req("click", "TopkSampler", 3); |
| 286 | int64_t ids[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; |
| 287 | req.Set(ids, 10); |
| 288 | |
| 289 | SamplingResponse res; |
| 290 | Status s = client->Sampling(&req, &res); |
| 291 | std::cout << "SampleTopkNeighbors: " << s.ToString() << std::endl; |
| 292 | |
| 293 | const int64_t* nbrs = res.GetNeighborIds(); |
| 294 | int32_t size = res.TotalNeighborCount(); |
| 295 | std::cout << "TotalNeighborCount: " << size << std::endl; |
| 296 | for (int32_t i = 0; i < size; ++i) { |
| 297 | std::cout << nbrs[i] << std::endl; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | void TestFullSampleNeighbors(Client* client) { |
| 302 | SamplingRequest req("click", "FullSampler", 3); |
no test coverage detected