Class WriteSinkFunction<IN>
- java.lang.Object
-
- org.apache.flink.streaming.api.functions.sink.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 theStreamingFileSinkfor 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.sink.SinkFunction
SinkFunction.Context
-
-
Constructor Summary
Constructors Constructor Description WriteSinkFunction(String path, WriteFormat<IN> format)Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcleanFile(String path)Deprecated.Creates target file if it does not exist, cleans it if it exists.voidinvoke(IN tuple)Deprecated.Implementation of the invoke method of the SinkFunction class.protected abstract voidresetParameters()Deprecated.Statements to be executed after writing a batch goes here.protected abstract booleanupdateCondition()Deprecated.Condition for writing the contents of tupleList and clearing it.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.streaming.api.functions.sink.SinkFunction
finish, invoke, writeWatermark
-
-
-
-
Field Detail
-
path
protected final String path
Deprecated.
-
format
protected WriteFormat<IN> format
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:
invokein interfaceSinkFunction<IN>
-
-