Interface StreamElementQueue<OUT>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void emitCompletedElement​(org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> output)
      Emits one completed element from the head of this queue into the given output.
      boolean hasCompletedElements()
      Checks if there is at least one completed head element.
      boolean isEmpty()
      True if the queue is empty; otherwise false.
      int size()
      Return the size of the queue.
      Optional<ResultFuture<OUT>> tryPut​(org.apache.flink.streaming.runtime.streamrecord.StreamElement streamElement)
      Tries to put the given element in the queue.
      List<org.apache.flink.streaming.runtime.streamrecord.StreamElement> values()
      Returns the collection of StreamElement currently contained in this queue for checkpointing.
    • Method Detail

      • tryPut

        Optional<ResultFuture<OUT>> tryPut​(org.apache.flink.streaming.runtime.streamrecord.StreamElement streamElement)
        Tries to put the given element in the queue. This operation succeeds if the queue has capacity left and fails if the queue is full.

        This method returns a handle to the inserted element that allows to set the result of the computation.

        Parameters:
        streamElement - the element to be inserted.
        Returns:
        A handle to the element if successful or Optional.empty() otherwise.
      • emitCompletedElement

        void emitCompletedElement​(org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> output)
        Emits one completed element from the head of this queue into the given output.

        Will not emit any element if no element has been completed (check hasCompletedElements() before entering any critical section).

        Parameters:
        output - the output into which to emit
      • hasCompletedElements

        boolean hasCompletedElements()
        Checks if there is at least one completed head element.
        Returns:
        True if there is a completed head element.
      • values

        List<org.apache.flink.streaming.runtime.streamrecord.StreamElement> values()
        Returns the collection of StreamElement currently contained in this queue for checkpointing.

        This includes all non-emitted, completed and non-completed elements.

        Returns:
        List of currently contained StreamElement.
      • isEmpty

        boolean isEmpty()
        True if the queue is empty; otherwise false.
        Returns:
        True if the queue is empty; otherwise false.
      • size

        int size()
        Return the size of the queue.
        Returns:
        The number of elements contained in this queue.