Returns the next batch of mutations along with the arena backing it. Note the returned batch can be empty when the file has unfinished version batch data that are in the next file.
| 397 | // Note the returned batch can be empty when the file has unfinished |
| 398 | // version batch data that are in the next file. |
| 399 | Optional<VersionedMutations> getNextBatch() { |
| 400 | for (auto& [version, m] : mutationBlocksByVersion) { |
| 401 | if (m.isComplete()) { |
| 402 | VersionedMutations vms; |
| 403 | vms.version = version; |
| 404 | vms.serializedMutations = m.serializedMutations; |
| 405 | vms.mutations = fileBackup::decodeMutationLogValue(vms.serializedMutations); |
| 406 | TraceEvent("Decode").detail("Version", vms.version).detail("N", vms.mutations.size()); |
| 407 | mutationBlocksByVersion.erase(version); |
| 408 | return vms; |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | // No complete versions |
| 413 | if (!mutationBlocksByVersion.empty()) { |
| 414 | TraceEvent(SevWarn, "UnfishedBlocks").detail("NumberOfVersions", mutationBlocksByVersion.size()); |
| 415 | } |
| 416 | return Optional<VersionedMutations>(); |
| 417 | } |
| 418 | |
| 419 | ACTOR static Future<Void> openFileImpl(DecodeProgress* self, Reference<IBackupContainer> container) { |
| 420 | Reference<IAsyncFile> fd = wait(container->readFile(self->file.fileName)); |
no test coverage detected