Class FeedbackTransformation<T>

  • Type Parameters:
    T - The type of the input elements and the feedback elements.

    @Internal
    public class FeedbackTransformation<T>
    extends Transformation<T>
    This represents a feedback point in a topology.

    This is different from how iterations work in batch processing. Once a feedback point is defined you can connect one or several Transformations as a feedback edges. Operations downstream from the feedback point will receive elements from the input of this feedback point and from the feedback edges.

    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 type of the input Transformation and the feedback Transformation must match.

    • Constructor Detail

      • FeedbackTransformation

        public FeedbackTransformation​(Transformation<T> input,
                                      Long waitTime)
        Creates a new FeedbackTransformation from the given input.
        Parameters:
        input - The input Transformation
        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<T> transform)
        Adds a feedback edge. The parallelism of the Transformation must match the parallelism of the input Transformation of this FeedbackTransformation
        Parameters:
        transform - The new feedback Transformation.
      • getFeedbackEdges

        public List<Transformation<T>> 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<T>
        Returns:
        The list of transitive predecessors.