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

Method addTask

fdbclient/FileBackupAgent.actor.cpp:3889–3920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3887 }
3888
3889 ACTOR static Future<Key> addTask(Reference<ReadYourWritesTransaction> tr,
3890 Reference<TaskBucket> taskBucket,
3891 Reference<Task> parentTask,
3892 Version beginVersion,
3893 std::string beginFile,
3894 int64_t beginBlock,
3895 int64_t batchSize,
3896 int64_t remainingInBatch = 0,
3897 TaskCompletionKey completionKey = TaskCompletionKey::noSignal(),
3898 Reference<TaskFuture> waitFor = Reference<TaskFuture>()) {
3899 Key doneKey = wait(completionKey.get(tr, taskBucket));
3900
3901 // Use high priority for dispatch tasks that have to queue more blocks for the current batch
3902 unsigned int priority = (remainingInBatch > 0) ? 1 : 0;
3903 state Reference<Task> task(
3904 new Task(RestoreDispatchTaskFunc::name, RestoreDispatchTaskFunc::version, doneKey, priority));
3905
3906 // Create a config from the parent task and bind it to the new task
3907 wait(RestoreConfig(parentTask).toTask(tr, task));
3908 Params.beginVersion().set(task, beginVersion);
3909 Params.batchSize().set(task, batchSize);
3910 Params.remainingInBatch().set(task, remainingInBatch);
3911 Params.beginBlock().set(task, beginBlock);
3912 Params.beginFile().set(task, beginFile);
3913
3914 if (!waitFor) {
3915 return taskBucket->addTask(tr, task);
3916 }
3917
3918 wait(waitFor->onSetAddTask(tr, taskBucket, task));
3919 return LiteralStringRef("OnSetAddTask");
3920 }
3921
3922 Future<Void> execute(Database cx,
3923 Reference<TaskBucket> tb,

Callers

nothing calls this directly

Calls 11

RestoreConfigClass · 0.85
toTaskMethod · 0.80
batchSizeMethod · 0.80
remainingInBatchMethod · 0.80
beginBlockMethod · 0.80
beginFileMethod · 0.80
getMethod · 0.65
setMethod · 0.65
beginVersionMethod · 0.45
addTaskMethod · 0.45
onSetAddTaskMethod · 0.45

Tested by

no test coverage detected