@Experimental public interface IterationBody extends Serializable
Notes that inside the iteration body, users could only create the subgraph from the variableStreams and dataStreams. Users could not refers to other data stream outside the
iteration through the closure, and could not add new sources / sinks inside the iteration.
Some operations are not supported inside the iterations:
DataStream.assignTimestampsAndWatermarks(WatermarkStrategy).
DataStream.iterate().
Currently we also not support nested exception.
The iteration body also requires that the parallelism of any stream in the initial variable streams must equal to the parallelism of the stream at the same index of the feedback variable streams returned by the iteration body.
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
IterationBody.PerRoundSubBody
The sub-graph inside the iteration body that should be executed as per-round.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static DataStreamList |
forEachRound(DataStreamList inputs,
IterationBody.PerRoundSubBody perRoundSubBody) |
IterationBodyResult |
process(DataStreamList variableStreams,
DataStreamList dataStreams)
This method creates the graph for the iteration body.
|
IterationBodyResult process(DataStreamList variableStreams, DataStreamList dataStreams)
Iterations for how the
iteration body can be executed and terminated.variableStreams - the variable streams, which will be updated via a feedback stream in
each round.dataStreams - the streams referred in the iteration body, which will only be emitted in
the first round.static DataStreamList forEachRound(DataStreamList inputs, IterationBody.PerRoundSubBody perRoundSubBody)
inputs - The inputs of the subgraph.perRoundSubBody - The computational logic that want to be executed as per-round.Copyright © 2019–2022 The Apache Software Foundation. All rights reserved.