Class AsyncWindowOperator<K,​IN,​ACC,​OUT,​W extends Window>

    • Field Detail

      • keySerializer

        protected final org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer
        For serializing the key in checkpoints.
      • windowSerializer

        protected final org.apache.flink.api.common.typeutils.TypeSerializer<W extends Window> windowSerializer
        For serializing the window in checkpoints.
      • allowedLateness

        protected final long allowedLateness
        The allowed lateness for elements. This is used for:
        • Deciding if an element should be dropped from a window due to lateness.
        • Clearing the state of a window if the system time passes the window.maxTimestamp + allowedLateness landmark.
      • lateDataOutputTag

        protected final org.apache.flink.util.OutputTag<IN> lateDataOutputTag
        OutputTag to use for late arriving events. Elements for which window.maxTimestamp + allowedLateness is smaller than the current watermark will be emitted to this.
      • numLateRecordsDropped

        protected transient org.apache.flink.metrics.Counter numLateRecordsDropped
    • Constructor Detail

      • AsyncWindowOperator

        public AsyncWindowOperator​(WindowAssigner<? super IN,​W> windowAssigner,
                                   org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer,
                                   org.apache.flink.api.java.functions.KeySelector<IN,​K> keySelector,
                                   org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
                                   org.apache.flink.api.common.state.v2.StateDescriptor<?> windowStateDescriptor,
                                   InternalAsyncWindowFunction<ACC,​OUT,​K,​W> windowFunction,
                                   AsyncTrigger<? super IN,​? super W> trigger,
                                   long allowedLateness,
                                   org.apache.flink.util.OutputTag<IN> lateDataOutputTag)
        Creates a new WindowOperator based on the given policies and user functions.
    • Method Detail

      • getOperatorAttributes

        public OperatorAttributes getOperatorAttributes()
        Description copied from interface: StreamOperator
        Called to get the OperatorAttributes of the operator. If there is no defined attribute, a default OperatorAttributes is built.
        Specified by:
        getOperatorAttributes in interface StreamOperator<K>
        Returns:
        OperatorAttributes of the operator.
      • sideOutput

        protected void sideOutput​(StreamRecord<IN> element)
        Write skipped late arriving element to SideOutput.
        Parameters:
        element - skipped late arriving element to side output
      • isWindowLate

        protected boolean isWindowLate​(W window)
        Returns true if the watermark is after the end timestamp plus the allowed lateness of the given window.
      • isElementLate

        protected boolean isElementLate​(StreamRecord<IN> element)
        Decide if a record is currently late, based on current watermark and allowed lateness.
        Parameters:
        element - The element to check
        Returns:
        The element for which should be considered when sideoutputs
      • registerCleanupTimer

        protected void registerCleanupTimer​(W window)
        Registers a timer to cleanup the content of the window.
        Parameters:
        window - the window whose state to discard
      • deleteCleanupTimer

        protected void deleteCleanupTimer​(W window)
        Deletes the cleanup timer set for the contents of the provided window.
        Parameters:
        window - the window whose state to discard
      • isCleanupTime

        protected final boolean isCleanupTime​(W window,
                                              long time)
        Returns true if the given time is the cleanup time for the given window.
      • getTrigger

        @VisibleForTesting
        public AsyncTrigger<? super IN,​? super W> getTrigger()
      • getKeySelector

        @VisibleForTesting
        public org.apache.flink.api.java.functions.KeySelector<IN,​K> getKeySelector()
      • getWindowAssigner

        @VisibleForTesting
        public WindowAssigner<? super IN,​W> getWindowAssigner()
      • getStateDescriptor

        @VisibleForTesting
        public org.apache.flink.api.common.state.v2.StateDescriptor<?> getStateDescriptor()