@PublicEvolving public class LocalCollectionOutputFormat<T> extends RichOutputFormat<T> implements InputTypeConfigurable
OutputFormat.InitializationContext
Constructor and Description |
---|
LocalCollectionOutputFormat(Collection<T> out) |
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.
|
void |
open(int taskNumber,
int numTasks)
Opens a parallel instance of the output format to store the result of its parallel instance.
|
void |
setInputType(TypeInformation<?> type,
ExecutionConfig executionConfig)
Method that is called on an
OutputFormat when it is
passed to the DataSet's output method. |
void |
writeRecord(T record)
Adds a record to the output.
|
getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
open
public LocalCollectionOutputFormat(Collection<T> out)
public void configure(Configuration parameters)
OutputFormat
This method is always called first on a newly instantiated output format.
configure
in interface OutputFormat<T>
parameters
- The configuration with all parameters.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>
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.
writeRecord
in interface OutputFormat<T>
record
- The records to add to the output.IOException
- Thrown, if the records could not be added due to an I/O problem.public void close() throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
close
in interface OutputFormat<T>
IOException
- Thrown, if the input could not be closed properly.public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig)
InputTypeConfigurable
OutputFormat
when it is
passed to the DataSet's output method. May be used to configures the output format based on
the data type.setInputType
in interface InputTypeConfigurable
type
- The data type of the input.executionConfig
- The execution config for this parallel execution.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.