| 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, |
nothing calls this directly
no test coverage detected