Class RecordWriter<T extends 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
      • numberOfSubpartitions

        protected final int numberOfSubpartitions
      • 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)
      • flushAll

        public void flushAll()
      • setMetricGroup

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

        public int getNumberOfSubpartitions()
      • isSubpartitionDerivable

        public boolean isSubpartitionDerivable()
        Whether the subpartition where an element comes from can be derived from the existing information. If false, the caller of this writer should attach the subpartition information onto an element before writing it to a subpartition, if the element needs this information afterward.
      • 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 subpartition.
        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.