Class WriteSinkFunction<IN>

  • Type Parameters:
    IN - Input tuple type
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, SinkFunction<IN>
    Direct Known Subclasses:
    WriteSinkFunctionByMillis

    @PublicEvolving
    @Deprecated
    public abstract class WriteSinkFunction<IN>
    extends Object
    implements SinkFunction<IN>
    Deprecated.
    Please use the StreamingFileSink for writing to files from a streaming program.
    Simple implementation of the SinkFunction writing tuples as simple text to the file specified by path. Tuples are collected to a list and written to the file periodically. The file specified by path is created if it does not exist, cleared if it exists before the writing.
    See Also:
    Serialized Form
    • Field Detail

      • path

        protected final String path
        Deprecated.
      • tupleList

        protected ArrayList<IN> tupleList
        Deprecated.
    • Constructor Detail

      • WriteSinkFunction

        public WriteSinkFunction​(String path,
                                 WriteFormat<IN> format)
        Deprecated.
    • Method Detail

      • cleanFile

        protected void cleanFile​(String path)
        Deprecated.
        Creates target file if it does not exist, cleans it if it exists.
        Parameters:
        path - is the path to the location where the tuples are written
      • updateCondition

        protected abstract boolean updateCondition()
        Deprecated.
        Condition for writing the contents of tupleList and clearing it.
        Returns:
        value of the updating condition
      • resetParameters

        protected abstract void resetParameters()
        Deprecated.
        Statements to be executed after writing a batch goes here.
      • invoke

        public void invoke​(IN tuple)
        Deprecated.
        Implementation of the invoke method of the SinkFunction class. Collects the incoming tuples in tupleList and appends the list to the end of the target file if updateCondition() is true or the current tuple is the endTuple.
        Specified by:
        invoke in interface SinkFunction<IN>