| 44 | constexpr int BATCH = 128; |
| 45 | |
| 46 | bool 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 | |
| 66 | bool ParseMetaPathConfig(const std::string& config, |
| 67 | std::vector<meta_path_t>* meta_paths) { |
no test coverage detected