MCPcopy Create free account
hub / github.com/apple/foundationdb / getNextBatch

Method getNextBatch

fdbbackup/FileDecoder.actor.cpp:399–417  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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));

Callers 1

Calls 7

decodeMutationLogValueFunction · 0.85
TraceEventClass · 0.85
detailMethod · 0.80
isCompleteMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected