Package org.jtrim2.taskgraph
package org.jtrim2.taskgraph
Defines the core interface for the task graph execution framework. The framework
allows for dynamically defining a computations with arbitrary dependencies and
execute the computations without blocking using resources to the fullest.
Building a task graph
-
The possible factories of the computations (called task node factories:
TaskFactory
) must be declared. These factories only define what is possible to be computed not what actually will be computed. - Once the task node factories were defined, some computation must be declared explicitly to be computed.
- After the initial required computations were declared, the framework will automatically create the task execution graph based on the dependencies of the computations.
-
With the task graph ready, it can be executed, which will eventually
notify its
CompletionStage
after all computations were completed.
Resource constraints
The framework allows restraining resource usage. There are two kinds of resources, the framework recognizes:-
Resources being used only during a computation of a task node and released
after the computation terminates. This resource usage can be limited by
appropriate selection of the
task executors
. - Resources associated with the output of computations. Outputs consume resources up until the point, no computation needs them. The management of such resources is the responsibility of the task graph execution implementation.
- See Also:
-
ClassDescriptionDefines a whole task execution graph.Defines an error handler to be called instead of the associated node computation when the node is not being executed due to a failed dependency.Defines the possible general outcomes of a task graph execution.Defines a callback notified whenever a failure occurs while trying to create or execute a task node.Contains utility methods to do task before or after a task node.Defines utility methods to implement task node factories.TaskFactory<R,
I> Defines a factory for creating task node function for the task execution graph.TaskFactoryConfig<R,I> Defines a complete definition of a task node factory.Allows to define task node factories to build a task graph from.Defines the configuration of a task node factory.TaskFactoryKey<R,I> Defines the key uniquely identifying a particular task node factory.Defines the properties of a task node factory.TheBuilder
used to createTaskFactoryProperties
instances.TaskFactorySetup<R,I> Defines a deferred creator of a task node factory.Defines a task node factory wrapping another task node factory.Defines the initial nodes of the task graph.Defines the properties used to control task graph building (not its execution).TheBuilder
used to createTaskGraphBuilderProperties
instances.Defines how to create task nodes, which is the first step in building a task execution graph.Defines an exception meaning that a task graph execution failed due to a node's action throwing an exception.Defines the result of a task graph execution.Defines a executor which executes an already built task execution graph.Defines the properties used to control task graph execution.TheBuilder
used to createTaskGraphExecutorProperties
instances.Defines factory methods to create a task graph executors.ATaskInputBinder
is used by task node factories to define the inputs of the task node they create.TaskInputRef<I>Defines a reference to the input of a task node.TaskNodeCreateArgs<R,I> Defines the properties used to create a task node.TaskNodeKey<R,I> Defines the key uniquely identifying a particular task node.Defines the properties of a task node.TheBuilder
used to createTaskNodeProperties
instances.Defines a task node wrapping another task node.Defines an exception to be thrown when a task execution is skipped but failing to compute a task is not considered an error for the whole computation.