T - the type of the record that can be emitted with this record writerpublic class RecordWriter<T extends org.apache.flink.core.io.IOReadableWritable> extends Object
The RecordWriter wraps the runtime's ResultPartitionWriter and takes care of
serializing records into buffers.
Important: it is necessary to call flush() after
all records have been written with emit(IOReadableWritable). This
ensures that all produced records are written to the output stream (incl.
partially filled ones).
| Modifier and Type | Field and Description |
|---|---|
protected ResultPartitionWriter |
writer |
| Constructor and Description |
|---|
RecordWriter(ResultPartitionWriter writer) |
RecordWriter(ResultPartitionWriter writer,
ChannelSelector<T> channelSelector) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastEmit(T record)
This is used to broadcast Streaming Watermarks in-band with records.
|
void |
broadcastEvent(AbstractEvent event) |
void |
clearBuffers() |
void |
emit(T record) |
void |
flush() |
void |
sendEndOfSuperstep() |
void |
setMetricGroup(IOMetricGroup metrics)
Sets the metric group for this RecordWriter.
|
void |
setReporter(AccumulatorRegistry.Reporter reporter)
Counter for the number of records emitted and the records processed.
|
protected final ResultPartitionWriter writer
public RecordWriter(ResultPartitionWriter writer)
public RecordWriter(ResultPartitionWriter writer, ChannelSelector<T> channelSelector)
public void emit(T record) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void broadcastEmit(T record) throws IOException, InterruptedException
ChannelSelector.IOExceptionInterruptedExceptionpublic void broadcastEvent(AbstractEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void sendEndOfSuperstep()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void flush()
throws IOException
IOExceptionpublic void clearBuffers()
public void setReporter(AccumulatorRegistry.Reporter reporter)
public void setMetricGroup(IOMetricGroup metrics)
metrics - Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.