public class SingleRecordWriter<T extends org.apache.flink.core.io.IOReadableWritable> extends Object implements RecordWriterDelegate<T>
AvailabilityProvider.AvailabilityHelperAVAILABLE| Constructor and Description |
|---|
SingleRecordWriter(RecordWriter<T> recordWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastEvent(AbstractEvent event)
Broadcasts the provided event to all the internal record writer instances.
|
void |
close() |
CompletableFuture<?> |
getAvailableFuture() |
RecordWriter<T> |
getRecordWriter(int outputIndex)
Returns the internal actual record writer instance based on the output index.
|
boolean |
isAvailable()
In order to best-effort avoid volatile access in
CompletableFuture.isDone(), we check the condition
of future == AVAILABLE firstly for getting probable performance benefits while hot looping. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisApproximatelyAvailablepublic SingleRecordWriter(RecordWriter<T> recordWriter)
public void broadcastEvent(AbstractEvent event) throws IOException
RecordWriterDelegatebroadcastEvent in interface RecordWriterDelegate<T extends org.apache.flink.core.io.IOReadableWritable>event - the event to be emitted to all the output channels.IOExceptionpublic RecordWriter<T> getRecordWriter(int outputIndex)
RecordWriterDelegategetRecordWriter in interface RecordWriterDelegate<T extends org.apache.flink.core.io.IOReadableWritable>outputIndex - the index respective to the record writer instance.public CompletableFuture<?> getAvailableFuture()
getAvailableFuture in interface AvailabilityProviderpublic boolean isAvailable()
AvailabilityProviderCompletableFuture.isDone(), we check the condition
of future == AVAILABLE firstly for getting probable performance benefits while hot looping.
It is always safe to use this method in performance nonsensitive scenarios to get the precise state.
isAvailable in interface AvailabilityProviderpublic void close()
close in interface AutoCloseableCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.