Interface CoProcessor

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default void close()
      Deprecated.
      Tear-down method for the user code.
      org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getProducedType​(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2)
      Deprecated.
      Gets the data type (as a TypeInformation) produced by this function or input format.
      default Map<String,​org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row>> getSidesOutProducedType​(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2)
      Deprecated.
      Declare the data type information of the sides out data produced by your function.
      void open​(org.apache.flink.configuration.Configuration configuration, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2, Map<String,​org.apache.flink.util.OutputTag<org.apache.flink.types.Row>> sidesOutputTag, org.apache.flink.api.common.functions.RuntimeContext rtCtx)
      Deprecated.
      Initialization method for the function.
      void processElement1​(org.apache.flink.types.Row value, org.apache.flink.streaming.api.functions.co.CoProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.types.Row> out)
      Deprecated.
      This method is called for each element in the first of the connected streams.
      void processElement2​(org.apache.flink.types.Row value, org.apache.flink.streaming.api.functions.co.CoProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.types.Row> out)
      Deprecated.
      This method is called for each element in the second of the connected streams.
    • Method Detail

      • getProducedType

        org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getProducedType​(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1,
                                                                                                         org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2)
        Deprecated.
        Gets the data type (as a TypeInformation) produced by this function or input format.
        Parameters:
        typeInfo1 - the input row type information from stream 1
        typeInfo2 - the input row type information from stream 2
        Returns:
        The data type produced by this function or input format.
      • getSidesOutProducedType

        default Map<String,​org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row>> getSidesOutProducedType​(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1,
                                                                                                                                           org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2)
        Deprecated.
        Declare the data type information of the sides out data produced by your function.
        Returns:
        the sides output type information
      • processElement1

        void processElement1​(org.apache.flink.types.Row value,
                             org.apache.flink.streaming.api.functions.co.CoProcessFunction.Context ctx,
                             org.apache.flink.util.Collector<org.apache.flink.types.Row> out)
                      throws Exception
        Deprecated.
        This method is called for each element in the first of the connected streams.

        This function can output zero or more elements using the Collector parameter and also update internal state or set timers using the CoProcessFunction.Context parameter.

        Parameters:
        value - The stream element
        ctx - A CoProcessFunction.Context that allows querying the timestamp of the element, querying the TimeDomain of the firing timer and getting a TimerService for registering timers and querying the time. The context is only valid during the invocation of this method, do not store it.
        out - The collector to emit resulting elements to
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • processElement2

        void processElement2​(org.apache.flink.types.Row value,
                             org.apache.flink.streaming.api.functions.co.CoProcessFunction.Context ctx,
                             org.apache.flink.util.Collector<org.apache.flink.types.Row> out)
                      throws Exception
        Deprecated.
        This method is called for each element in the second of the connected streams.

        This function can output zero or more elements using the Collector parameter and also update internal state or set timers using the CoProcessFunction.Context parameter.

        Parameters:
        value - The stream element
        ctx - A CoProcessFunction.Context that allows querying the timestamp of the element, querying the TimeDomain of the firing timer and getting a TimerService for registering timers and querying the time. The context is only valid during the invocation of this method, do not store it.
        out - The collector to emit resulting elements to
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • open

        void open​(org.apache.flink.configuration.Configuration configuration,
                  org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo1,
                  org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo2,
                  Map<String,​org.apache.flink.util.OutputTag<org.apache.flink.types.Row>> sidesOutputTag,
                  org.apache.flink.api.common.functions.RuntimeContext rtCtx)
           throws Exception
        Deprecated.
        Initialization method for the function.
        Parameters:
        configuration - The configuration containing the parameters attached to the contract
        typeInfo1 - the input row type information from stream 1
        typeInfo2 - the input row type information from stream 2
        sidesOutputTag - Side output typeinfo and tag dict if any
        rtCtx - a runtime context that allow you for example to manage state
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • close

        default void close()
                    throws Exception
        Deprecated.
        Tear-down method for the user code. It is called after the last call to the main working methods. For functions that are part of an iteration, this method will be invoked after each iteration superstep.

        This method can be used for clean up work.

        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.