Class CoFeedbackTransformation<F>

  • Type Parameters:
    F - The type of the feedback elements.

    @Internal
    public class CoFeedbackTransformation<F>
    extends Transformation<F>
    This represents a feedback point in a topology. The type of the feedback elements need not match the type of the upstream Transformation because the only allowed operations after a CoFeedbackTransformation are TwoInputTransformations. The upstream Transformation will be connected to the first input of the Co-Transform while the feedback edges will be connected to the second input.

    Both the partitioning of the input and the feedback edges is preserved. They can also have differing partitioning strategies. This requires, however, that the parallelism of the feedback Transformations must match the parallelism of the input Transformation.

    The upstream Transformation is not wired to this CoFeedbackTransformation. It is instead directly wired to the TwoInputTransformation after this CoFeedbackTransformation.

    This is different from Iterations in batch processing.

    See Also:
    FeedbackTransformation
    • Constructor Detail

      • CoFeedbackTransformation

        public CoFeedbackTransformation​(int parallelism,
                                        TypeInformation<F> feedbackType,
                                        Long waitTime)
        Creates a new CoFeedbackTransformation from the given input.
        Parameters:
        parallelism - The parallelism of the upstream Transformation and the feedback edges.
        feedbackType - The type of the feedback edges
        waitTime - The wait time of the feedback operator. After the time expires the operation will close and not receive any more feedback elements.
    • Method Detail

      • addFeedbackEdge

        public void addFeedbackEdge​(Transformation<F> transform)
        Adds a feedback edge. The parallelism of the Transformation must match the parallelism of the input Transformation of the upstream Transformation.
        Parameters:
        transform - The new feedback Transformation.
      • getFeedbackEdges

        public List<Transformation<F>> getFeedbackEdges()
        Returns the list of feedback Transformations.
      • getWaitTime

        public Long getWaitTime()
        Returns the wait time. This is the amount of time that the feedback operator keeps listening for feedback elements. Once the time expires the operation will close and will not receive further elements.
      • getTransitivePredecessorsInternal

        protected List<Transformation<?>> getTransitivePredecessorsInternal()
        Description copied from class: Transformation
        Returns all transitive predecessor Transformations of this Transformation. This is, for example, used when determining whether a feedback edge of an iteration actually has the iteration head as a predecessor.
        Specified by:
        getTransitivePredecessorsInternal in class Transformation<F>
        Returns:
        The list of transitive predecessors.