This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting support for replay in the main task system (shouldn't be too much more effort) Test should be failing at the moment!
- Loading branch information
Showing
28 changed files
with
372 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2017 Fulcrum Genomics LLC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
package dagr.core.exec | ||
|
||
import dagr.core.execsystem2.TaskStatusLogger | ||
import dagr.core.reporting.FinalStatusReporter | ||
import dagr.core.reporting.ReportingDef.{TaskLogger, TaskRegister} | ||
import dagr.core.tasksystem.Task | ||
import com.fulcrumgenomics.commons.CommonsDef.yieldAndThen | ||
|
||
import scala.collection.mutable.ListBuffer | ||
|
||
/** All executors of tasks should extend this trait. */ | ||
trait Executor extends FinalStatusReporter { | ||
|
||
/** A list of [[TaskRegister]]s that will be notified when a list of tasks is returned by [[Task.getTasks]]. */ | ||
protected val registers: ListBuffer[TaskRegister] = ListBuffer[TaskRegister]() | ||
|
||
/** A list of [[TaskCache]] to use to determine if a task should be manually succeeded. */ | ||
protected val taskCaches: ListBuffer[TaskCache] = ListBuffer[TaskCache]() | ||
|
||
/** Adds the [[TaskRegister]] to the list of registers to be notified when a list of tasks is returned by [[Task.getTasks]] */ | ||
def withTaskRegister(register: TaskRegister): this.type = yieldAndThen[this.type](this)(this.registers.append(register)) | ||
|
||
/** Adds the [[TaskCache]] to the list of caches to use to determine if a task should be manually succeeded. */ | ||
def withTaskCache(taskCache: TaskCache): this.type = yieldAndThen[this.type](this) { | ||
withTaskRegister(taskCache) | ||
this.taskCaches.append(taskCache) | ||
} | ||
|
||
/** Start the execution of this task and all tasks that depend on it. Returns the number of tasks that were not | ||
* executed. A given task should only be attempted once. */ | ||
def execute(task: Task): Int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.