Enum Class DefaultPipelineController.PipelineState
java.lang.Object
java.lang.Enum<DefaultPipelineController.PipelineState>
io.aleph0.yap.core.pipeline.DefaultPipelineController.PipelineState
- All Implemented Interfaces:
Serializable,Comparable<DefaultPipelineController.PipelineState>,Constable
- Enclosing class:
DefaultPipelineController
public static enum DefaultPipelineController.PipelineState
extends Enum<DefaultPipelineController.PipelineState>
The internal state of a pipeline. The pipeline starts in the
DefaultTaskController.TaskState.READY state. The
controller then moves the pipeline through states according to the various events that occur,
where events are modeled as methods in this class.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe pipeline is done processing and has shut down.The user hasrequested cancellationand the pipeline is in the process of shutting down.The pipeline is done processing and has shut down.The pipeline is done processing and has shut down.One or more tasks havefailedand the pipeline is in the process of shutting down.The initial state of the pipeline.The pipeline is running. -
Method Summary
Modifier and TypeMethodDescriptionValidate the transition from this state to the target state.Returns the enum constant of this class with the specified name.values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
READY
The initial state of the pipeline.On task start, the controller immediately moves toRUNNING. -
RUNNING
The pipeline is running. The following conditions must be true:- One or more tasks have been started
- No tasks have failed
- The user has not requested cancellation
The controller stays in this state until one of the following events:
-
CANCELING
The user hasrequested cancellationand the pipeline is in the process of shutting down. The following conditions must be true:- The user has requested cancellation
- At least one task is still running
- No tasks have failed
The controller stays in this state until one of the following events:
-
FAILING
One or more tasks havefailedand the pipeline is in the process of shutting down. The following conditions must be true:- At least one task has failed
- At least one task is still running
The controller stays in this state until one of the following events:
-
COMPLETED
The pipeline is done processing and has shut down. The user did not request cancellation, and all tasks completed normally. This is a terminal state. -
CANCELED
The pipeline is done processing and has shut down. The user requested cancellation, and all tasks either completed normally or canceled. This is a terminal state. -
FAILED
The pipeline is done processing and has shut down. At least one task failed. This is a terminal state.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
to
public abstract DefaultPipelineController.PipelineState to(DefaultPipelineController.PipelineState target) Validate the transition from this state to the target state. The controller will call this method to validate the transition before moving to the target state. If the transition is valid, the method will return the target state. If the transition is invalid, the method will throw anIllegalStateException.- Parameters:
target- the target state- Returns:
- the target state, if the transition is valid
- Throws:
IllegalStateException- if the transition is invalid
-