| 1261 | } |
| 1262 | |
| 1263 | Future<std::vector<RangeFile>> BackupContainerFileSystem::old_listRangeFiles(Version beginVersion, Version endVersion) { |
| 1264 | // Get the cleaned (without slashes) first and last folders that could contain relevant results. |
| 1265 | std::string firstPath = BackupContainerFileSystemImpl::cleanFolderString( |
| 1266 | BackupContainerFileSystemImpl::old_rangeVersionFolderString(beginVersion)); |
| 1267 | std::string lastPath = BackupContainerFileSystemImpl::cleanFolderString( |
| 1268 | BackupContainerFileSystemImpl::old_rangeVersionFolderString(endVersion)); |
| 1269 | |
| 1270 | std::function<bool(std::string const&)> pathFilter = [=](const std::string& folderPath) { |
| 1271 | // Remove slashes in the given folder path so that the '/' positions in the version folder string do not |
| 1272 | // matter |
| 1273 | std::string cleaned = BackupContainerFileSystemImpl::cleanFolderString(folderPath); |
| 1274 | |
| 1275 | return StringRef(firstPath).startsWith(cleaned) || StringRef(lastPath).startsWith(cleaned) || |
| 1276 | (cleaned > firstPath && cleaned < lastPath); |
| 1277 | }; |
| 1278 | |
| 1279 | return map(listFiles("ranges/", pathFilter), [=](const FilesAndSizesT& files) { |
| 1280 | std::vector<RangeFile> results; |
| 1281 | RangeFile rf; |
| 1282 | for (auto& f : files) { |
| 1283 | if (BackupContainerFileSystemImpl::pathToRangeFile(rf, f.first, f.second) && rf.version >= beginVersion && |
| 1284 | rf.version <= endVersion) |
| 1285 | results.push_back(rf); |
| 1286 | } |
| 1287 | return results; |
| 1288 | }); |
| 1289 | } |
| 1290 | |
| 1291 | Future<std::vector<RangeFile>> BackupContainerFileSystem::listRangeFiles(Version beginVersion, Version endVersion) { |
| 1292 | // Until the old folder scheme is no longer supported, read files stored using old folder scheme |
nothing calls this directly
no test coverage detected