T
- type of elements@Deprecated @PublicEvolving public class TextOutputFormat<T> extends 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>
Deprecated.
Formatter that transforms values into their
String representations. |
FileOutputFormat.OutputDirectoryMode
OutputFormat.InitializationContext
FILE_PARAMETER_KEY, outputFilePath, stream
Constructor and Description |
---|
TextOutputFormat(Path outputPath)
Deprecated.
|
TextOutputFormat(Path outputPath,
String charset)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
String |
getCharsetName()
Deprecated.
|
void |
open(int taskNumber,
int numTasks)
Deprecated.
Opens a parallel instance of the output format to store the result of its parallel instance.
|
void |
setCharsetName(String charsetName)
Deprecated.
|
String |
toString()
Deprecated.
|
void |
writeRecord(T record)
Deprecated.
Adds a record to the output.
|
close, configure, getDirectoryFileName, getOutputDirectoryMode, getOutputFilePath, getWriteMode, initDefaultsFromConfiguration, initializeGlobal, setOutputDirectoryMode, setOutputFilePath, setWriteMode, tryCleanupOnError
getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
open
public TextOutputFormat(Path outputPath)
public String getCharsetName()
public void setCharsetName(String charsetName) throws IllegalCharsetNameException, UnsupportedCharsetException
public void open(int taskNumber, int numTasks) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be configured.
open
in interface OutputFormat<T>
open
in class FileOutputFormat<T>
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an I/O problem.public void writeRecord(T record) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
record
- The records to add to the output.IOException
- Thrown, if the records could not be added due to an I/O problem.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.