OUT
- Type of the elements to write.@Experimental public abstract class OutputFormatBase<OUT,V> extends RichOutputFormat<OUT>
OutputFormat.InitializationContext
Modifier | Constructor and Description |
---|---|
protected |
OutputFormatBase(int maxConcurrentRequests,
Duration maxConcurrentRequestsTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the format waiting for pending writes and reports errors.
|
void |
open(int taskNumber,
int numTasks)
Open the format and initializes the flush system.
|
protected void |
postClose()
Tear down the OutputFormat.
|
protected void |
postOpen()
Initialize the OutputFormat.
|
protected abstract CompletionStage<V> |
send(OUT record)
Send the actual record for writing.
|
void |
writeRecord(OUT record)
Asynchronously write a record and deal with
maxConcurrentRequests . |
getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, open
protected OutputFormatBase(int maxConcurrentRequests, Duration maxConcurrentRequestsTimeout)
public final void open(int taskNumber, int numTasks)
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.protected void postOpen()
open(int, int)
.public final void writeRecord(OUT record) throws IOException
maxConcurrentRequests
.
To specify how a record is written, please override the send(Object)
method.record
- The records to add to the output.IOException
- Thrown, if the records could not be added due to an I/O problem.protected abstract CompletionStage<V> send(OUT record)
public final void close() throws IOException
IOException
- Thrown, if the input could not be closed properly.protected void postClose()
close()
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.