MCPcopy Create free account
hub / github.com/Tencent/embedx / LoadMetaPathConfig

Function LoadMetaPathConfig

src/tools/graph/random_walker_main.cc:46–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44constexpr int BATCH = 128;
45
46bool LoadMetaPathConfig(const std::string& file,
47 std::vector<meta_path_t>* meta_paths) {
48 LineParser line_parser;
49 if (!line_parser.Open(file)) {
50 return false;
51 }
52
53 meta_paths->clear();
54 std::vector<SeqValue> seq_values;
55 while (line_parser.NextBatch<SeqValue>(BATCH, &seq_values)) {
56 for (const auto& seq_value : seq_values) {
57 meta_paths->emplace_back(
58 meta_path_t(seq_value.nodes.begin(), seq_value.nodes.end()));
59 }
60 }
61
62 DXINFO("Loaded meta path size: %zu.", meta_paths->size());
63 return !meta_paths->empty();
64}
65
66bool ParseMetaPathConfig(const std::string& config,
67 std::vector<meta_path_t>* meta_paths) {

Callers 1

InitWalkerInfoMethod · 0.85

Calls 2

OpenMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected