Class StreamOperatorWrapper<OUT,​OP extends StreamOperator<OUT>>


  • @Internal
    public class StreamOperatorWrapper<OUT,​OP extends StreamOperator<OUT>>
    extends Object
    This class handles the finish, endInput and other related logic of a StreamOperator. It also automatically propagates the finish operation to the next wrapper that the next points to, so we can use next to link all operator wrappers in the operator chain and finish all operators only by calling the finish(StreamTaskActionExecutor, StopMode) method of the header operator wrapper.
    • Method Detail

      • isClosed

        public boolean isClosed()
        Checks if the wrapped operator has been closed.

        Note that this method must be called in the task thread.

      • endOperatorInput

        public void endOperatorInput​(int inputId)
                              throws Exception
        Ends an input of the operator contained by this wrapper.
        Parameters:
        inputId - the input ID starts from 1 which indicates the first input.
        Throws:
        Exception
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
                                      throws Exception
        Throws:
        Exception
      • notifyCheckpointSubsumed

        public void notifyCheckpointSubsumed​(long checkpointId)
                                      throws Exception
        Throws:
        Exception
      • getStreamOperator

        public OP getStreamOperator()
      • finish

        public void finish​(StreamTaskActionExecutor actionExecutor,
                           StopMode stopMode)
                    throws Exception
        Finishes the wrapped operator and propagates the finish operation to the next wrapper that the next points to.

        Note that this method must be called in the task thread, because we need to call MailboxExecutor.yield() to take the mails of closing operator and running timers and run them.

        Throws:
        Exception