Class PrintSinkOutputWriter<IN>
- java.lang.Object
-
- org.apache.flink.api.common.functions.util.PrintSinkOutputWriter<IN>
-
- All Implemented Interfaces:
Serializable,AutoCloseable,SinkWriter<IN>
@Internal public class PrintSinkOutputWriter<IN> extends Object implements Serializable, SinkWriter<IN>
Print sink output writer for DataStream and DataSet print API.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.connector.sink2.SinkWriter
SinkWriter.Context
-
-
Constructor Summary
Constructors Constructor Description PrintSinkOutputWriter()PrintSinkOutputWriter(boolean stdErr)PrintSinkOutputWriter(String sinkIdentifier, boolean stdErr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush(boolean endOfInput)Called on checkpoint or end of input so that the writer to flush all pending data for at-least-once.voidopen(int subtaskIndex, int numParallelSubtasks)StringtoString()voidwrite(IN record)voidwrite(IN element, SinkWriter.Context context)Adds an element to the writer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.connector.sink2.SinkWriter
writeWatermark
-
-
-
-
Constructor Detail
-
PrintSinkOutputWriter
public PrintSinkOutputWriter()
-
PrintSinkOutputWriter
public PrintSinkOutputWriter(boolean stdErr)
-
PrintSinkOutputWriter
public PrintSinkOutputWriter(String sinkIdentifier, boolean stdErr)
-
-
Method Detail
-
open
public void open(int subtaskIndex, int numParallelSubtasks)
-
write
public void write(IN record)
-
write
public void write(IN element, SinkWriter.Context context) throws IOException, InterruptedException
Description copied from interface:SinkWriterAdds an element to the writer.- Specified by:
writein interfaceSinkWriter<IN>- Parameters:
element- The input recordcontext- The additional information about the input record- Throws:
IOException- if fail to add an element.InterruptedException
-
flush
public void flush(boolean endOfInput) throws IOException, InterruptedExceptionDescription copied from interface:SinkWriterCalled on checkpoint or end of input so that the writer to flush all pending data for at-least-once.- Specified by:
flushin interfaceSinkWriter<IN>- Throws:
IOExceptionInterruptedException
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-