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

Method _execute

fdbclient/FileBackupAgent.actor.cpp:2993–3038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2991 }
2992
2993 ACTOR static Future<Void> _execute(Database cx,
2994 Reference<TaskBucket> taskBucket,
2995 Reference<FutureBucket> futureBucket,
2996 Reference<Task> task) {
2997 state RestoreConfig restore(task);
2998
2999 state RestoreFile rangeFile = Params.inputFile().get(task);
3000 state int64_t readOffset = Params.readOffset().get(task);
3001 state int64_t readLen = Params.readLen().get(task);
3002
3003 TraceEvent("FileRestoreRangeStart")
3004 .suppressFor(60)
3005 .detail("RestoreUID", restore.getUid())
3006 .detail("FileName", rangeFile.fileName)
3007 .detail("FileVersion", rangeFile.version)
3008 .detail("FileSize", rangeFile.fileSize)
3009 .detail("ReadOffset", readOffset)
3010 .detail("ReadLen", readLen)
3011 .detail("TaskInstance", THIS_ADDR);
3012
3013 state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(cx));
3014 state Future<Reference<IBackupContainer>> bc;
3015 state Future<std::vector<KeyRange>> restoreRanges;
3016 state Future<Key> addPrefix;
3017 state Future<Key> removePrefix;
3018
3019 loop {
3020 try {
3021 tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
3022 tr->setOption(FDBTransactionOptions::LOCK_AWARE);
3023
3024 bc = restore.sourceContainer().getOrThrow(tr);
3025 restoreRanges = restore.getRestoreRangesOrDefault(tr);
3026 addPrefix = restore.addPrefix().getD(tr);
3027 removePrefix = restore.removePrefix().getD(tr);
3028
3029 wait(taskBucket->keepRunning(tr, task));
3030
3031 wait(success(bc) && success(restoreRanges) && success(addPrefix) && success(removePrefix) &&
3032 checkTaskVersion(tr->getDatabase(), task, name, version));
3033 break;
3034
3035 } catch (Error& e) {
3036 wait(tr->onError(e));
3037 }
3038 }
3039
3040 state Reference<IAsyncFile> inFile = wait(bc.get()->readFile(rangeFile.fileName));
3041 state Standalone<VectorRef<KeyValueRef>> blockData = wait(decodeRangeFileBlock(inFile, readOffset, readLen));

Callers

nothing calls this directly

Calls 15

TraceEventClass · 0.85
inputFileMethod · 0.80
readOffsetMethod · 0.80
readLenMethod · 0.80
detailMethod · 0.80
keepRunningMethod · 0.80
getMethod · 0.65
onErrorMethod · 0.65
setOptionMethod · 0.65
getDatabaseMethod · 0.65
getUidMethod · 0.45
getOrThrowMethod · 0.45

Tested by

no test coverage detected