MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / populateLayoutFromFile

Function populateLayoutFromFile

src/storage/storage.cpp:170–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168} // namespace
169
170void populateLayoutFromFile(const std::filesystem::path &path, storage::BaseDataLayout &layout)
171{
172 tar::FileReader reader(path, tar::FileReader::VerifyFingerprint);
173
174 std::vector<tar::FileReader::FileEntry> entries;
175 reader.List(std::back_inserter(entries));
176
177 for (const auto &entry : entries)
178 {
179 const auto name_end = entry.name.rfind(".meta");
180 if (name_end == std::string::npos)
181 {
182 auto number_of_elements = reader.ReadElementCount64(entry.name);
183 layout.SetBlock(entry.name, Block{number_of_elements, entry.size, entry.offset});
184 }
185 }
186}
187
188Storage::Storage(StorageConfig config_) : config(std::move(config_)) {}
189

Callers 2

PopulateLayoutMethod · 0.85
MMapMemoryAllocatorMethod · 0.85

Calls 3

SetBlockMethod · 0.80
ListMethod · 0.45
ReadElementCount64Method · 0.45

Tested by

no test coverage detected