public interface PipelineContext
The possible output types:
single shot output
A single object is produced.iterator output
Multiple objects of the same type are produced.The possible input types:
single input
A single object is consumed.Modifier and Type | Method and Description |
---|---|
<T> void |
addDelayedSingleOutput(PipelineStep step,
String outputName,
String description,
Class<T> outputType,
Consumer<Consumer<T>> output)
Register an output with a single value.
|
<T> void |
addIteratorOutput(PipelineStep step,
String outputName,
String description,
Class<T> outputType,
Supplier<Iterator<T>> outputSupplier)
Register an output with an iterator of values.
|
<T> void |
addMasterStorageBuilder(PipelineStep step,
String inputName,
String inputDescription,
Class<T> inputType,
MasterStorages.MasterStorageBuilder<T> builder)
Add a
MasterStorage building node. |
<T> void |
addRepeatedInput(PipelineStep step,
String inputName,
String description,
Class<T> inputType,
Consumer<T> inputConsumer)
Register an input which accepts repeated values.
|
<T> void |
addSingleInput(PipelineStep step,
String inputName,
String description,
Class<T> inputType,
Consumer<T> inputConsumer)
Register an input with a single value.
|
<T> void |
addSingleShotOutput(PipelineStep step,
String outputName,
String description,
Class<T> outputType,
Supplier<T> outputSupplier)
Register an output with a single value.
|
void |
addStatefulMetricOutput(PipelineStep step,
String outputName,
String description,
Supplier<Long> outputSupplier)
Register a secondary output providing metrics.
|
<U,V> void |
addStatelessTransformation(PipelineStep step,
String inputName,
String inputDescription,
Class<U> inputType,
String outputName,
String outputDescription,
Class<V> outputType,
Function<U,V> transformation)
Add stateless transformation.
|
void |
addStep(PipelineStep step) |
<T> T |
getLastStep(Class<T> stepType)
Get last step from the pipeline.
|
void addStep(PipelineStep step)
<T> void addSingleShotOutput(PipelineStep step, String outputName, String description, Class<T> outputType, Supplier<T> outputSupplier)
T
- Type of the returned valuestep
- The involved stepoutputName
- Short descriptive name of the outputdescription
- Human readable description of the outputoutputType
- Type of the returned valueoutputSupplier
- Supplier of the returned value. Will be invoked after PipelineStep.init()
.<T> void addDelayedSingleOutput(PipelineStep step, String outputName, String description, Class<T> outputType, Consumer<Consumer<T>> output)
output
parameter is a Consumer
which expects the target Consumer
of the output value to be introduced. When no
Consumer.accept(java.lang.Object)
invocation is made then the specific output value is not necessarily
composed.
A typical application is an optional output of a (memory) extensive builder node.
T
- Type of the returned valuestep
- The involved stepoutputName
- Short descriptive name of the outputdescription
- Human readable description of the outputoutputType
- Type of the returned valueoutput
- Callback to be invoked by the<T> void addIteratorOutput(PipelineStep step, String outputName, String description, Class<T> outputType, Supplier<Iterator<T>> outputSupplier)
T
- Type of the returned valuestep
- The involved stepoutputName
- Short descriptive name of the outputdescription
- Human readable description of the outputoutputType
- Type of the returned valueoutputSupplier
- Supplier of the returned value. Will be invoked after PipelineStep.init()
.<T> void addSingleInput(PipelineStep step, String inputName, String description, Class<T> inputType, Consumer<T> inputConsumer)
T
- Type of the input.step
- The involved step.inputName
- Short descriptive name of the input.description
- Human readable description of the input.inputType
- Type of the expected value.inputConsumer
- Consumer of the input value. Will be invoked before PipelineStep.init()
at most once.<T> void addRepeatedInput(PipelineStep step, String inputName, String description, Class<T> inputType, Consumer<T> inputConsumer)
T
- Type of the input.step
- The involved step.inputName
- Short descriptive name of the input.description
- Human readable description of the input.inputType
- Type of the expected value.inputConsumer
- Consumer of the input value. Will be invoked after PipelineStep.init()
zero or multiple times.void addStatefulMetricOutput(PipelineStep step, String outputName, String description, Supplier<Long> outputSupplier)
step
- The involved stepoutputName
- Short descriptive name of the outputdescription
- Human readable description of the outputoutputSupplier
- Supplier of the returned value. Will be invoked after PipelineStep.init()
.<U,V> void addStatelessTransformation(PipelineStep step, String inputName, String inputDescription, Class<U> inputType, String outputName, String outputDescription, Class<V> outputType, Function<U,V> transformation)
U
- Input typeV
- Output typestep
- The involved stepinputName
- Short descriptive name of the input.inputDescription
- Human readable description of the input.inputType
- Input typeoutputName
- Short descriptive name of the outputoutputDescription
- Human readable description of the outputoutputType
- Output typetransformation
- <T> T getLastStep(Class<T> stepType) throws IllegalStateException
Step
instances which manipulate a "normal" step.T
- Expected type of the last stepstepType
- Expected type of the last stepIllegalStateException
- when last step type does not match<T> void addMasterStorageBuilder(PipelineStep step, String inputName, String inputDescription, Class<T> inputType, MasterStorages.MasterStorageBuilder<T> builder)
MasterStorage
building node.
This is an order sensitive reduce/collect step which accepts ordered, possibly sparse data. The passed
builder
is considered an input of the node/step. The output is not specified with this call.T
- Input typestep
- The involved stepinputName
- Short descriptive name of the input.inputDescription
- Human readable description of the input.inputType
- Input typebuilder
- Input for the builder. Note that MasterStorages.MasterStorageBuilder#build()
is invoked
before accessing output(s) but the returned instance will be ignored.