Class/Object

dagr.core.execsystem

TaskManager

Related Docs: object TaskManager | package execsystem

Permalink

class TaskManager extends TaskManagerLike with TaskTracker with FinalStatusReporter with LazyLogging

A manager of tasks.

No validation of whether or not we actually have the provided system or in-Jvm resources will occur.

Linear Supertypes
FinalStatusReporter, TaskTracker, LazyLogging, TaskManagerLike, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskManager
  2. FinalStatusReporter
  3. TaskTracker
  4. LazyLogging
  5. TaskManagerLike
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskManager(taskManagerResources: SystemResources = ..., scriptsDirectory: Option[Path] = None, logDirectory: Option[Path] = None, scheduler: Scheduler = ..., simulate: Boolean = false, sleepMilliseconds: Int = 1000)

    Permalink

    taskManagerResources

    the set of task manager resources, otherwise we use the default

    scriptsDirectory

    the scripts directory, otherwise a temporary directory will be used

    logDirectory

    the log directory, otherwise a temporary directory will be used

    scheduler

    the scheduler, otherwise we use the default

    simulate

    true if we are to simulate running tasks, false otherwise

    sleepMilliseconds

    the time to wait in milliseconds to wait between trying to schedule tasks.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to any2stringadd[TaskManager] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TaskManager, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to ArrowAssoc[TaskManager] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. val actualLogsDirectory: Path

    Permalink
    Attributes
    protected
  7. def addTask(task: Task, enclosingNode: Option[GraphNode], ignoreExists: Boolean = false): TaskId

    Permalink

    Adds a task to be managed

    Adds a task to be managed

    Throws an IllegalArgumentException if a cycle was found after logging each strongly connected component with a cycle in the graph.

    task

    the given task.

    ignoreExists

    true if we just return the task id for already added tasks, false if we are to throw an IllegalArgumentException

    returns

    the task identifier.

    Attributes
    protected[dagr.core.execsystem]
    Definition Classes
    TaskTracker
  8. def addTask(task: Task): TaskId

    Permalink

    Adds a task to be managed

    Adds a task to be managed

    task

    the given task.

    returns

    the task identifier.

    Definition Classes
    TaskTracker → TaskManagerLike
  9. def addTasks(tasks: Task*): Seq[TaskId]

    Permalink

    Adds tasks to be managed

    Adds tasks to be managed

    tasks

    the given tasks.

    returns

    the task identifiers.

    Definition Classes
    TaskTracker → TaskManagerLike
  10. def addTasks(tasks: Traversable[Task], enclosingNode: Option[GraphNode] = None, ignoreExists: Boolean = false): List[TaskId]

    Permalink

    Adds tasks to be managed

    Adds tasks to be managed

    tasks

    the given tasks.

    ignoreExists

    true if we just return the task id for already added tasks, false if we are to throw an IllegalArgumentException

    returns

    the task identifiers.

    Attributes
    protected[dagr.core.execsystem]
    Definition Classes
    TaskTracker
  11. def allPredecessorsAdded(task: Task): Boolean

    Permalink

    Returns true if all the predecessors of this task are known (have been added), false otherwise.

    Returns true if all the predecessors of this task are known (have been added), false otherwise.

    Attributes
    protected
    Definition Classes
    TaskTracker
  12. def apply(id: TaskId): GraphNode

    Permalink

    Gets the graph execution node for the given id.

    Gets the graph execution node for the given id. If there is no task being tracked with that id, throws a NoSuchElementException.

    id

    the id to lookup.

    returns

    the associated task.

    Definition Classes
    TaskTracker → TaskManagerLike
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def checkForCycles(task: Task): Unit

    Permalink

    Checks for cycles in the graph to which the task belongs.

    Checks for cycles in the graph to which the task belongs.

    Throws an IllegalArgumentException if a cycle was found after logging each strongly connected component with a cycle in the graph.

    task

    a task in the graph to check.

    Attributes
    protected
    Definition Classes
    TaskTracker
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def ensuring(cond: (TaskManager) ⇒ Boolean, msg: ⇒ Any): TaskManager

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to Ensuring[TaskManager] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (TaskManager) ⇒ Boolean): TaskManager

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to Ensuring[TaskManager] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): TaskManager

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to Ensuring[TaskManager] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): TaskManager

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to Ensuring[TaskManager] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to StringFormat[TaskManager] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  25. def graphNodeFor(task: Task): Option[GraphNode]

    Permalink

    Get the graph node associated with the task

    Get the graph node associated with the task

    task

    a task in the graph

    returns

    the graph node associated with the task if found, None otherwise

    Definition Classes
    TaskTracker
  26. def graphNodeFor(id: TaskId): Option[GraphNode]

    Permalink

    Get the graph node associated with the task identifier

    Get the graph node associated with the task identifier

    id

    the task identifier

    returns

    the graph node associated with the task identifier if found, None otherwise

    Definition Classes
    TaskTracker
  27. def graphNodeStateFor(task: Task): Option[GraphNodeState.Value]

    Permalink

    Get the execution state of the task.

    Get the execution state of the task.

    task

    the task.

    returns

    the execution state of the task.

    Definition Classes
    TaskTracker
  28. def graphNodeStateFor(id: TaskId): Option[GraphNodeState.Value]

    Permalink

    Get the execution state of the task.

    Get the execution state of the task.

    id

    the task identifier.

    returns

    the execution state of the task.

    Definition Classes
    TaskTracker
  29. def graphNodes: Iterable[GraphNode]

    Permalink

    Get the graph nodes in the execution graph.

    Get the graph nodes in the execution graph.

    returns

    the graph nodes, in no particular order.

    Definition Classes
    TaskTracker
  30. def graphNodesInStateFor(state: GraphNodeState.Value): Iterable[GraphNode]

    Permalink

    Gets the graph nodes in a given state.

    Gets the graph nodes in a given state.

    state

    the state of the returned graph nodes.

    returns

    the graph nodes with the given state.

    Attributes
    protected
    Definition Classes
    TaskTracker
  31. def graphNodesInStatesFor(states: Traversable[GraphNodeState.Value]): Iterable[GraphNode]

    Permalink

    Gets the graph nodes in the given states.

    Gets the graph nodes in the given states.

    states

    the states of the returned graph nodes.

    returns

    the graph nodes with the given states.

    Attributes
    protected
    Definition Classes
    TaskTracker
  32. def graphNodesWithPredecessors: Iterable[GraphNode]

    Permalink

    Gets the graph nodes that imply they have predecessors.

    Gets the graph nodes that imply they have predecessors.

    returns

    the graph nodes that have predecessors (unmet dependencies).

    Attributes
    protected
    Definition Classes
    TaskTracker
  33. def hasFailedTasks: Boolean

    Permalink

    Checks if we have failed tasks.

    Checks if we have failed tasks.

    returns

    true if we have failed tasks, false otherwise.

    Definition Classes
    TaskTracker → TaskManagerLike
  34. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. def joinOnRunningTasks(millis: Long): Unit

    Permalink

    For testing purposes only.

    For testing purposes only.

    Attributes
    protected
  37. def logPathFor(task: Task, taskId: TaskId, attemptIndex: Int): Path

    Permalink

    Generates a path to file to store the log output of the task

    Generates a path to file to store the log output of the task

    Attributes
    protected
    Definition Classes
    TaskManagerTaskTracker
  38. def logReport(loggerMethod: (String) ⇒ Unit, delimiter: String = " "): Unit

    Permalink

    Writes a delimited string of the status of all tasks managed

    Writes a delimited string of the status of all tasks managed

    loggerMethod

    the method to use to write task status information, one line at a time

    delimiter

    the delimiter between entries in a row

    Definition Classes
    FinalStatusReporter
  39. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  40. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. def predecessorsOf(task: Task): Option[Traversable[GraphNode]]

    Permalink

    Gets the predecessor graph nodes of the given task in the execution graph.

    Gets the predecessor graph nodes of the given task in the execution graph.

    This assumes that all predecessors of this task have been added with addTasks and not removed.

    task

    the task to lookup.

    returns

    the list of precedessors, or Nil if this task has no predecessors. If there were predecessors that are not currently being tracked, None will be returned instead.

    Attributes
    protected
    Definition Classes
    TaskTracker
  44. def readyTasksList: List[UnitTask]

    Permalink
    Attributes
    protected[dagr.core]
  45. def replaceTask(original: Task, replacement: Task): Boolean

    Permalink

    Replace the original task with the replacement task and update any internal references.

    Replace the original task with the replacement task and update any internal references. This will terminate the task if it is running.

    original

    the original task to replace.

    replacement

    the replacement task.

    returns

    true if we are successful, false if the original is not being tracked.

    Definition Classes
    TaskManagerTaskTracker → TaskManagerLike
  46. def runToCompletion(failFast: Boolean): BiMap[Task, TaskExecutionInfo]

    Permalink

    Run all tasks managed to either completion, failure, or inability to schedule.

    Run all tasks managed to either completion, failure, or inability to schedule.

    This will terminate tasks that were still running before returning in the case of failure or inability to schedule.

    returns

    a bi-directional map from the set of tasks to their execution information.

    Definition Classes
    TaskManager → TaskManagerLike
  47. def runningTasksMap: Map[UnitTask, ResourceSet]

    Permalink

    Returns a map of running tasks and the resource set they were scheduled with.

  48. def scriptPathFor(task: Task, taskId: TaskId, attemptIndex: Int): Path

    Permalink

    Generates a path to a file to hold the task command

    Generates a path to a file to hold the task command

    Attributes
    protected
    Definition Classes
    TaskManagerTaskTracker
  49. def stepExecution(): (Traversable[Task], Traversable[Task], Traversable[Task], Traversable[Task])

    Permalink

    Run a a single iteration of managing tasks.

    Run a a single iteration of managing tasks.

    1. Get tasks that have completed and update their state. 2. Update any resolved dependencies in the execution graph. 3. Get tasks for any task that has no predecessors until no more can be found. 4. Schedule tasks and start running them.

    returns

    a tuple of: (1) tasks that can be scheduled. (2) tasks that were scheduled. (3) tasks that are running prior to scheduling. (4) the tasks that have completed prior to scheduling.

    Definition Classes
    TaskManager → TaskManagerLike
  50. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  51. def taskExecutionInfoFor(node: GraphNode): Option[TaskExecutionInfo]

    Permalink

    Get the task's execution information if it exists.

    Get the task's execution information if it exists.

    node

    the node associated with a task.

    returns

    the task execution information if the task is managed, None otherwise

    Definition Classes
    TaskTracker
  52. def taskExecutionInfoFor(task: Task): Option[TaskExecutionInfo]

    Permalink

    Get the task's execution information if it exists.

    Get the task's execution information if it exists.

    task

    the task.

    returns

    the task execution information if the task is managed, None otherwise

    Definition Classes
    TaskTracker → TaskManagerLike
  53. def taskExecutionInfoFor(id: TaskId): Option[TaskExecutionInfo]

    Permalink

    Get the task's execution information if it exists.

    Get the task's execution information if it exists.

    id

    the task identifier.

    returns

    the task execution information if the task is managed, None otherwise

    Definition Classes
    TaskTracker → TaskManagerLike
  54. def taskFor(task: Task): Option[TaskId]

    Permalink

    Get the task identifier for the given task.

    Get the task identifier for the given task.

    task

    the task.

    returns

    the task identifier, None if the task is not being managed.

    Definition Classes
    TaskTracker → TaskManagerLike
  55. def taskFor(id: TaskId): Option[Task]

    Permalink

    Gets the task associated with the identifier, if any

    Gets the task associated with the identifier, if any

    id

    the task id

    returns

    the task associate with the id if found, None otherwise

    Definition Classes
    TaskTracker → TaskManagerLike
  56. def taskIds(): Iterable[TaskId]

    Permalink

    Get the task identifiers for all tracked tasks.

    Get the task identifiers for all tracked tasks.

    returns

    the task ids

    Definition Classes
    TaskTracker → TaskManagerLike
  57. def taskStatusFor(id: TaskId): Option[TaskStatus.Value]

    Permalink

    Get the task's associated TaskStatus.

    Get the task's associated TaskStatus.

    id

    the task identifier.

    returns

    the task status if the task is managed, None otherwise.

    Definition Classes
    TaskTracker → TaskManagerLike
  58. def taskStatusFor(task: Task): Option[TaskStatus.Value]

    Permalink

    Get the task's associated TaskStatus.

    Get the task's associated TaskStatus.

    task

    the task.

    returns

    the task status if the task is managed, None otherwise.

    Definition Classes
    TaskTracker → TaskManagerLike
  59. def taskToInfoBiMapFor: BiMap[Task, TaskExecutionInfo]

    Permalink

    Get the bi-directional map between managed tasks and their associated task execution information.

    Get the bi-directional map between managed tasks and their associated task execution information.

    returns

    the task and task execution information bi-directional map.

    Definition Classes
    TaskTracker → TaskManagerLike
  60. def terminateTask(taskId: TaskId): Boolean

    Permalink

    Attempts to terminate a task's underlying process.

    Attempts to terminate a task's underlying process.

    taskId

    the identifier of the task to terminate

    returns

    true if successful, false otherwise

    Attributes
    protected
  61. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  62. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. def [B](y: B): (TaskManager, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from TaskManager to ArrowAssoc[TaskManager] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from FinalStatusReporter

Inherited from TaskTracker

Inherited from LazyLogging

Inherited from TaskManagerLike

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TaskManager to any2stringadd[TaskManager]

Inherited by implicit conversion StringFormat from TaskManager to StringFormat[TaskManager]

Inherited by implicit conversion Ensuring from TaskManager to Ensuring[TaskManager]

Inherited by implicit conversion ArrowAssoc from TaskManager to ArrowAssoc[TaskManager]

Ungrouped