Class DefaultPipelineController
java.lang.Object
io.aleph0.yap.core.pipeline.DefaultPipelineController
- All Implemented Interfaces:
PipelineController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumThe internal state of a pipeline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()The maximum amount of time to wait for a lifecycle event, after whichPipelineController.onHeartbeat()will be called.Called when the pipeline has been requested to be cancelled.Called when no lifecycle events have occurred withinthe heartbeat interval.voidCalled when the pipeline has been cancelled.voidCalled when the pipeline has been completed.voidCalled when the pipeline has failed.Called when the pipeline has been started.Called when a task has been cancelled.Called when a task has been completed.onTaskFailed(String id, Throwable error) Called when a task has failed.onTaskStarted(String id) Called when a task has been started.
-
Constructor Details
-
DefaultPipelineController
-
-
Method Details
-
builder
-
onPipelineStarted
Description copied from interface:PipelineControllerCalled when the pipeline has been started. Called as the first event only.- Specified by:
onPipelineStartedin interfacePipelineController- Returns:
- the next actions to perform
-
onTaskStarted
Description copied from interface:PipelineControllerCalled when a task has been started. Called for each task as the first event.- Specified by:
onTaskStartedin interfacePipelineController- Parameters:
id- the id of the task- Returns:
- the next actions to perform
-
onTaskCompleted
Description copied from interface:PipelineControllerCalled when a task has been completed. No more events will be sent for this task.- Specified by:
onTaskCompletedin interfacePipelineController- Parameters:
id- the id of the task- Returns:
- the next actions to perform
-
onTaskCancelled
Description copied from interface:PipelineControllerCalled when a task has been cancelled. No more events will be sent for this task.- Specified by:
onTaskCancelledin interfacePipelineController- Parameters:
id- the id of the task- Returns:
- the next actions to perform
-
onTaskFailed
Description copied from interface:PipelineControllerCalled when a task has failed. No more events will be sent for this task.- Specified by:
onTaskFailedin interfacePipelineController- Parameters:
id- the id of the taskerror- the error that caused the task to fail- Returns:
- the next actions to perform
-
onHeartbeat
Description copied from interface:PipelineControllerCalled when no lifecycle events have occurred withinthe heartbeat interval. This ensures that the controller has periodic access to execute actions even if no lifecycle events are occurring, for example to time out tasks or to perform maintenance tasks.- Specified by:
onHeartbeatin interfacePipelineController- Returns:
- the next action to perform
-
onCancelRequested
Description copied from interface:PipelineControllerCalled when the pipeline has been requested to be cancelled. This is a request, not a command, and the pipeline may choose to ignore it.- Specified by:
onCancelRequestedin interfacePipelineController- Returns:
- the next actions to perform
-
onPipelineCompleted
public void onPipelineCompleted()Description copied from interface:PipelineControllerCalled when the pipeline has been completed. This is the last event that will be called.- Specified by:
onPipelineCompletedin interfacePipelineController
-
onPipelineFailed
Description copied from interface:PipelineControllerCalled when the pipeline has failed. This is the last event that will be called.- Specified by:
onPipelineFailedin interfacePipelineController
-
onPipelineCancelled
public void onPipelineCancelled()Description copied from interface:PipelineControllerCalled when the pipeline has been cancelled. This is the last event that will be called.- Specified by:
onPipelineCancelledin interfacePipelineController
-
getHeartbeatInterval
Description copied from interface:PipelineControllerThe maximum amount of time to wait for a lifecycle event, after whichPipelineController.onHeartbeat()will be called.- Specified by:
getHeartbeatIntervalin interfacePipelineController
-