IT
- The type of the consumed records.@Public public interface OutputFormat<IT> extends Serializable
The life cycle of an output format is the following:
Modifier and Type | Interface and Description |
---|---|
static interface |
OutputFormat.InitializationContext
The context exposes some runtime info for initializing output format.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Method that marks the end of the life-cycle of parallel output instance.
|
void |
configure(Configuration parameters)
Configures this output format.
|
default void |
open(int taskNumber,
int numTasks)
Deprecated.
Use
open(InitializationContext) instead |
default void |
open(OutputFormat.InitializationContext context)
Opens a parallel instance of the output format to store the result of its parallel instance.
|
void |
writeRecord(IT record)
Adds a record to the output.
|
void configure(Configuration parameters)
This method is always called first on a newly instantiated output format.
parameters
- The configuration with all parameters.@Deprecated default void open(int taskNumber, int numTasks) throws IOException
open(InitializationContext)
insteadWhen this method is called, the output format it guaranteed to be configured.
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.default void open(OutputFormat.InitializationContext context) throws IOException
When this method is called, the output format it guaranteed to be configured.
context
- The context to get task parallel infos.IOException
- Thrown, if the output could not be opened due to an I/O problem.void writeRecord(IT record) throws IOException
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.void close() throws IOException
When this method is called, the output format it guaranteed to be opened.
IOException
- Thrown, if the input could not be closed properly.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.