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.
|
| 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.
|
| Constructor and Description |
|---|
DelimitedOutputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(org.apache.flink.configuration.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(org.apache.flink.types.Record rec,
byte[] target)
This method is called for every record so serialize itself into the given target array.
|
void |
writeRecord(org.apache.flink.types.Record record) |
public static final String RECORD_DELIMITER
public static final String WRITE_BUFFER_SIZE
public void configure(org.apache.flink.configuration.Configuration config)
configure in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>configure in class org.apache.flink.api.common.io.FileOutputFormat<org.apache.flink.types.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 org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>open in class org.apache.flink.api.common.io.FileOutputFormat<org.apache.flink.types.Record>IOExceptionpublic void close()
throws IOException
close in interface org.apache.flink.api.common.io.OutputFormat<org.apache.flink.types.Record>close in class org.apache.flink.api.common.io.FileOutputFormat<org.apache.flink.types.Record>IOExceptionpublic abstract int serializeRecord(org.apache.flink.types.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(org.apache.flink.types.Record record)
throws IOException
IOExceptionpublic static DelimitedOutputFormat.ConfigBuilder configureDelimitedFormat(FileDataSink target)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.