Class RecordWriter<T extends org.apache.flink.core.io.IOReadableWritable>

    • Field Detail

      • DEFAULT_OUTPUT_FLUSH_THREAD_NAME

        @VisibleForTesting
        public static final String DEFAULT_OUTPUT_FLUSH_THREAD_NAME
        Default name for the output flush thread, if no name with a task reference is given.
        See Also:
        Constant Field Values
      • numberOfChannels

        protected final int numberOfChannels
      • serializer

        protected final org.apache.flink.core.memory.DataOutputSerializer serializer
      • rng

        protected final Random rng
      • flushAlways

        protected final boolean flushAlways
    • Method Detail

      • alignedBarrierTimeout

        public void alignedBarrierTimeout​(long checkpointId)
                                   throws IOException
        Throws:
        IOException
      • abortCheckpoint

        public void abortCheckpoint​(long checkpointId,
                                    CheckpointException cause)
      • serializeRecord

        @VisibleForTesting
        public static ByteBuffer serializeRecord​(org.apache.flink.core.memory.DataOutputSerializer serializer,
                                                 org.apache.flink.core.io.IOReadableWritable record)
                                          throws IOException
        Throws:
        IOException
      • flushAll

        public void flushAll()
      • setMetricGroup

        public void setMetricGroup​(TaskIOMetricGroup metrics)
        Sets the metric group for this RecordWriter.
      • emit

        public abstract void emit​(T record)
                           throws IOException
        This is used to send regular records.
        Throws:
        IOException
      • randomEmit

        public void randomEmit​(T record)
                        throws IOException
        This is used to send LatencyMarks to a random target channel.
        Throws:
        IOException
      • broadcastEmit

        public abstract void broadcastEmit​(T record)
                                    throws IOException
        This is used to broadcast streaming Watermarks in-band with records.
        Throws:
        IOException
      • close

        public void close()
        Closes the writer. This stops the flushing thread (if there is one).
      • setMaxOverdraftBuffersPerGate

        public void setMaxOverdraftBuffersPerGate​(int maxOverdraftBuffersPerGate)
        Sets the max overdraft buffer size of per gate.