Package com.levigo.jadice.server.core
Class SubPipeline
- java.lang.Object
-
- com.levigo.jadice.server.core.SubPipeline
-
public class SubPipeline extends Object
In oder to start a dynamic sub pipeline on server side during a running job this builder class can start some more nodes and workers on behalf of another node. TheNode
s of this sub pipline must already be connected to each other viaNode.appendSuccessor(Node)
andNode.prependPredecessor(Node)
, but the first and last Node—which might be both the one and onlyNode
—must be announced via the methodsstartWith(StreamBundle, Node)
andendWith(Node, StreamBundle)
.- Since:
- jadice server 5.3.1.0
- See Also:
JobListener.subPipelineCreated(com.levigo.jadice.server.Job, Node, java.util.Set)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SubPipeline
endWith(Node lastChild, StreamBundle output)
The sub pipeline shall end at the givenNode
and shall provide its processed data through the givenStreamBundle
.static SubPipeline
forParent(NodeWorker<?> parent)
Start the creation of a sub pipelineSubPipeline
inheritLimits()
void
start()
Creates and starts the sub pipeline.SubPipeline
startWith(StreamBundle input, Node firstChild)
The sub pipeline shall start at the givenNode
and will be feed with data through the givenStreamBundle
.
-
-
-
Method Detail
-
forParent
public static SubPipeline forParent(NodeWorker<?> parent)
Start the creation of a sub pipeline- Parameters:
parent
- the sub pipeline will be created on behalf of thisNode
- Returns:
- a new sub pipeline builder (fluent style API)
-
startWith
public SubPipeline startWith(StreamBundle input, Node firstChild)
The sub pipeline shall start at the givenNode
and will be feed with data through the givenStreamBundle
. Calling this method if mandatory.- Parameters:
input
- TheStreamBundle
that feeds the sub pipeline with data which already must be complete.firstChild
- The firstNode
of the sub pipeline- Returns:
- the
SubPipeline
builder itself (fluent style API)
-
endWith
public SubPipeline endWith(Node lastChild, StreamBundle output)
The sub pipeline shall end at the givenNode
and shall provide its processed data through the givenStreamBundle
. Calling this method if mandatory.- Parameters:
lastChild
- the lastNode
of the sub pipelineoutput
- The resultingStream
s of the sub pipeline shall be provided here- Returns:
- the
SubPipeline
builder itself (fluent style API)
-
inheritLimits
public SubPipeline inheritLimits()
Call the method if allNode
s of the sub pipeline shall inherit theLimit
s of the parentNode
. Calling this method if optional.- Returns:
- the
SubPipeline
builder itself (fluent style API)
-
start
public void start() throws ConfigurationException
Creates and starts the sub pipeline. This builder must not be re-used after the start of the sub pipeline has happened.- Throws:
ConfigurationException
- if preconditions were not met.
-
-