Class PrintSinkFunction<IN>

  • Type Parameters:
    IN - Input record type
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.api.common.SupportsConcurrentExecutionAttempts, SinkFunction<IN>

    @PublicEvolving
    public class PrintSinkFunction<IN>
    extends RichSinkFunction<IN>
    implements org.apache.flink.api.common.SupportsConcurrentExecutionAttempts
    Implementation of the SinkFunction writing every tuple to the standard output or standard error stream.

    Four possible format options: sinkIdentifier:taskId> output <- sinkIdentifier provided, parallelism > 1 sinkIdentifier> output <- sinkIdentifier provided, parallelism == 1 taskId> output <- no sinkIdentifier provided, parallelism > 1 output <- no sinkIdentifier provided, parallelism == 1

    See Also:
    Serialized Form
    • Constructor Detail

      • PrintSinkFunction

        public PrintSinkFunction()
        Instantiates a print sink function that prints to standard out.
      • PrintSinkFunction

        public PrintSinkFunction​(boolean stdErr)
        Instantiates a print sink function that prints to standard out.
        Parameters:
        stdErr - True, if the format should print to standard error instead of standard out.
      • PrintSinkFunction

        public PrintSinkFunction​(String sinkIdentifier,
                                 boolean stdErr)
        Instantiates a print sink function that prints to standard out and gives a sink identifier.
        Parameters:
        stdErr - True, if the format should print to standard error instead of standard out.
        sinkIdentifier - Message that identify sink and is prefixed to the output of the value
    • Method Detail

      • open

        @Deprecated
        public void open​(org.apache.flink.configuration.Configuration parameters)
                  throws Exception
        Deprecated.
        This method is deprecated since Flink 1.19. The users are recommended to implement open(OpenContext openContext) and override open(Configuration parameters) with an empty body instead. 1. If you implement open(OpenContext openContext), the open(OpenContext openContext) will be invoked and the open(Configuration parameters) won't be invoked. 2. If you don't implement open(OpenContext openContext), the open(Configuration parameters) will be invoked in the default implementation of the open(OpenContext openContext).
        Initialization method for the PrintSinkFunction.
        Specified by:
        open in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        open in class org.apache.flink.api.common.functions.AbstractRichFunction
        Parameters:
        parameters - The configuration containing the parameters attached to the contract.
        Throws:
        Exception - if an error happens.
        See Also:
        FLIP-344: Remove parameter in RichFunction#open