T
- type of elements@PublicEvolving
public class TextOutputFormat<T>
extends org.apache.flink.api.common.io.FileOutputFormat<T>
FileOutputFormat
that writes objects to a text file.
Objects are converted to Strings using either Object.toString()
or a TextOutputFormat.TextFormatter
.
Modifier and Type | Class and Description |
---|---|
static interface |
TextOutputFormat.TextFormatter<IN>
Formatter that transforms values into their
String representations. |
Constructor and Description |
---|
TextOutputFormat(org.apache.flink.core.fs.Path outputPath) |
TextOutputFormat(org.apache.flink.core.fs.Path outputPath,
String charset) |
Modifier and Type | Method and Description |
---|---|
String |
getCharsetName() |
void |
open(int taskNumber,
int numTasks) |
void |
setCharsetName(String charsetName) |
String |
toString() |
void |
writeRecord(T record) |
close, configure, getDirectoryFileName, getOutputDirectoryMode, getOutputFilePath, getWriteMode, initDefaultsFromConfiguration, initializeGlobal, setOutputDirectoryMode, setOutputFilePath, setWriteMode, tryCleanupOnError
public TextOutputFormat(org.apache.flink.core.fs.Path outputPath)
public TextOutputFormat(org.apache.flink.core.fs.Path outputPath, String charset)
public String getCharsetName()
public void setCharsetName(String charsetName) throws IllegalCharsetNameException, UnsupportedCharsetException
public void open(int taskNumber, int numTasks) throws IOException
open
in interface org.apache.flink.api.common.io.OutputFormat<T>
open
in class org.apache.flink.api.common.io.FileOutputFormat<T>
IOException
public void writeRecord(T record) throws IOException
IOException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.