public abstract class DelimitedOutputFormat extends FileOutputFormat
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DelimitedOutputFormat.AbstractConfigBuilder<T>
A builder used to set parameters to the input format's configuration in a fluent way.
|
static class |
DelimitedOutputFormat.ConfigBuilder
A builder used to set parameters to the input format's configuration in a fluent way.
|
FileOutputFormat.OutputDirectoryMode| Modifier and Type | Field and Description |
|---|---|
static String |
RECORD_DELIMITER
The configuration key for the entry that defines the record delimiter.
|
static String |
WRITE_BUFFER_SIZE
The configuration key for the entry that defines the write-buffer size.
|
FILE_PARAMETER_KEY, outputFilePath, stream| Constructor and Description |
|---|
DelimitedOutputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Configuration config)
Calls the super classes to configure themselves and reads the config parameters for the delimiter and
the write buffer size.
|
static DelimitedOutputFormat.ConfigBuilder |
configureDelimitedFormat(FileDataSink target)
Creates a configuration builder that can be used to set the input format's parameters to the config in a fluent
fashion.
|
void |
open(int taskNumber,
int numTasks) |
abstract int |
serializeRecord(Record rec,
byte[] target)
This method is called for every record so serialize itself into the given target array.
|
void |
writeRecord(Record record) |
configureFileFormat, getDirectoryFileName, getOutputDirectoryMode, getOutputFilePath, getWriteMode, initializeGlobal, setOutputDirectoryMode, setOutputFilePath, setWriteMode, tryCleanupOnErrorpublic static final String RECORD_DELIMITER
public static final String WRITE_BUFFER_SIZE
public void configure(Configuration config)
configure in interface OutputFormat<Record>configure in class FileOutputFormat<Record>config - The configuration to read the parameters from.FileOutputFormat.configure(org.apache.flink.configuration.Configuration)public void open(int taskNumber,
int numTasks)
throws IOException
open in interface OutputFormat<Record>open in class FileOutputFormat<Record>IOExceptionpublic void close()
throws IOException
close in interface OutputFormat<Record>close in class FileOutputFormat<Record>IOExceptionpublic abstract int serializeRecord(Record rec, byte[] target) throws Exception
The absolute value of the returned integer can be given as a hint how large an array is required. The array is resized to the return value's absolute value, if that is larger than the current array size. Otherwise, the array size is simply doubled.
rec - The record to be serialized.target - The array to serialize the record into.Exception - If the user code produces an exception that prevents processing the record, it should
throw it such that the engine recognizes the situation as a fault.public void writeRecord(Record record) throws IOException
IOExceptionpublic static DelimitedOutputFormat.ConfigBuilder configureDelimitedFormat(FileDataSink target)
Copyright © 2015 The Apache Software Foundation. All rights reserved.