public class MultipleRecordWriters<T extends IOReadableWritable> extends Object implements RecordWriterDelegate<T>
AvailabilityProvider.AvailabilityHelper
AVAILABLE
Constructor and Description |
---|
MultipleRecordWriters(List<RecordWriter<T>> recordWriters) |
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. |
void |
setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
Sets the max overdraft buffer size of per gate.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, isApproximatelyAvailable, or
public MultipleRecordWriters(List<RecordWriter<T>> recordWriters)
public void broadcastEvent(AbstractEvent event) throws IOException
RecordWriterDelegate
broadcastEvent
in interface RecordWriterDelegate<T extends IOReadableWritable>
event
- the event to be emitted to all the output channels.IOException
public RecordWriter<T> getRecordWriter(int outputIndex)
RecordWriterDelegate
getRecordWriter
in interface RecordWriterDelegate<T extends IOReadableWritable>
outputIndex
- the index respective to the record writer instance.public void setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
RecordWriterDelegate
setMaxOverdraftBuffersPerGate
in interface RecordWriterDelegate<T extends IOReadableWritable>
public CompletableFuture<?> getAvailableFuture()
getAvailableFuture
in interface AvailabilityProvider
public boolean isAvailable()
AvailabilityProvider
CompletableFuture.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 AvailabilityProvider
public void close()
close
in interface AutoCloseable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.