T - the type of the record that can be emitted with this record writerpublic abstract class RecordWriter<T extends org.apache.flink.core.io.IOReadableWritable> extends Object implements AvailabilityProvider
The RecordWriter wraps the runtime's ResultPartitionWriter and takes care of channel
selection and serializing records into bytes.
AvailabilityProvider.AvailabilityHelper| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_OUTPUT_FLUSH_THREAD_NAME
Default name for the output flush thread, if no name with a task reference is given.
|
protected boolean |
flushAlways |
protected int |
numberOfChannels |
protected Random |
rng |
protected org.apache.flink.core.memory.DataOutputSerializer |
serializer |
protected ResultPartitionWriter |
targetPartition |
AVAILABLE| 限定符和类型 | 方法和说明 |
|---|---|
void |
abortCheckpoint(long checkpointId,
CheckpointException cause) |
void |
alignedBarrierTimeout(long checkpointId) |
abstract void |
broadcastEmit(T record)
This is used to broadcast streaming Watermarks in-band with records.
|
void |
broadcastEvent(AbstractEvent event) |
void |
broadcastEvent(AbstractEvent event,
boolean isPriorityEvent) |
protected void |
checkErroneous() |
void |
close()
Closes the writer.
|
abstract void |
emit(T record)
This is used to send regular records.
|
protected void |
emit(T record,
int targetSubpartition) |
void |
flushAll() |
CompletableFuture<?> |
getAvailableFuture() |
void |
randomEmit(T record)
This is used to send LatencyMarks to a random target channel.
|
static ByteBuffer |
serializeRecord(org.apache.flink.core.memory.DataOutputSerializer serializer,
org.apache.flink.core.io.IOReadableWritable record) |
void |
setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
Sets the max overdraft buffer size of per gate.
|
void |
setMetricGroup(TaskIOMetricGroup metrics)
Sets the metric group for this RecordWriter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, isApproximatelyAvailable, isAvailable, or@VisibleForTesting public static final String DEFAULT_OUTPUT_FLUSH_THREAD_NAME
protected final ResultPartitionWriter targetPartition
protected final int numberOfChannels
protected final org.apache.flink.core.memory.DataOutputSerializer serializer
protected final Random rng
protected final boolean flushAlways
protected void emit(T record, int targetSubpartition) throws IOException
IOExceptionpublic void broadcastEvent(AbstractEvent event) throws IOException
IOExceptionpublic void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException
IOExceptionpublic void alignedBarrierTimeout(long checkpointId)
throws IOException
IOExceptionpublic void abortCheckpoint(long checkpointId,
CheckpointException cause)
@VisibleForTesting public static ByteBuffer serializeRecord(org.apache.flink.core.memory.DataOutputSerializer serializer, org.apache.flink.core.io.IOReadableWritable record) throws IOException
IOExceptionpublic void flushAll()
public void setMetricGroup(TaskIOMetricGroup metrics)
public CompletableFuture<?> getAvailableFuture()
getAvailableFuture 在接口中 AvailabilityProviderpublic abstract void emit(T record) throws IOException
IOExceptionpublic void randomEmit(T record) throws IOException
IOExceptionpublic abstract void broadcastEmit(T record) throws IOException
IOExceptionpublic void close()
protected void checkErroneous()
throws IOException
IOExceptionpublic void setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.