Interface PropagationQueue<T>

  • Type Parameters:
    T -
    All Superinterfaces:
    Propagator
    All Known Implementing Classes:
    StaticPropagationQueue

    public interface PropagationQueue<T>
    extends Propagator
    A propagation queue is an ordered collection of items that need to be sent to the next node. This operation is called propagation.

    In order to properly update joins, removing stale data before joining is required. To that end, retracts need to be propagated first, then updates and finally inserts. Other than that, the order of propagation is the order of insertion into the queue.

    Once an item propagates, it is set to a stable state that indicates it has been propagated, either TupleState.OK or TupleState.DEAD. Subsequent nodes will only see their input tuples in these states.

    The propagation operation consists of three phases:

    1. Retracts: Propagator.propagateRetracts()
    2. Updates: Propagator.propagateUpdates()
    3. Inserts: Propagator.propagateInserts()
    All of them need to be called, and in this order. Otherwise, the queue will be in an inconsistent state, likely resulting in runtime exceptions and/or score corruption.

    The reason why these operations are not combined into a single method is the fact that multiple nodes may need to execute their retracts first, and only when all of those are propagated, the rest of the phases can start.

    See Also:
    Even more information about propagation.
    • Method Detail

      • insert

        void insert​(T item)
      • update

        void update​(T item)