| 109 | } |
| 110 | |
| 111 | bool ParseFeatureIdToTestIdMapping(std::string const & path, ankerl::unordered_dense::map<uint32_t, uint64_t> & mapping) |
| 112 | { |
| 113 | bool success = true; |
| 114 | feature::ForEachFeature(path, [&](FeatureType & feature, uint32_t fid) |
| 115 | { |
| 116 | auto const testIdStr = feature.GetMetadata(feature::Metadata::FMD_TEST_ID); |
| 117 | uint64_t testId; |
| 118 | if (!strings::to_uint(testIdStr, testId)) |
| 119 | { |
| 120 | LOG(LERROR, ("Can't parse test id from:", testIdStr, "for the feature", fid)); |
| 121 | success = false; |
| 122 | return; |
| 123 | } |
| 124 | mapping.emplace(fid, testId); |
| 125 | }); |
| 126 | return success; |
| 127 | } |
| 128 | |
| 129 | search::CBV GetLocalities(std::string const & dataPath) |
| 130 | { |