Class FileChannelOutputView

  • All Implemented Interfaces:
    DataOutput, org.apache.flink.core.memory.DataOutputView, org.apache.flink.core.memory.MemorySegmentWritable

    public class FileChannelOutputView
    extends AbstractPagedOutputView
    A DataOutputView that is backed by a BlockChannelWriter, making it effectively a data output stream. The view writes it data in blocks to the underlying channel.
    • Method Detail

      • close

        public void close()
                   throws IOException
        Closes this output, writing pending data and releasing the memory.
        Throws:
        IOException - Thrown, if the pending data could not be written.
      • closeAndDelete

        public void closeAndDelete()
                            throws IOException
        Closes this output, writing pending data and releasing the memory.
        Throws:
        IOException - Thrown, if the pending data could not be written.
      • getBlockCount

        public int getBlockCount()
        Gets the number of blocks written by this output view.
        Returns:
        The number of blocks written by this output view.
      • getBytesInLatestSegment

        public int getBytesInLatestSegment()
        Gets the number of bytes written in the latest memory segment.
        Returns:
        The number of bytes written in the latest memory segment.
      • getWriteOffset

        public long getWriteOffset()
      • nextSegment

        protected org.apache.flink.core.memory.MemorySegment nextSegment​(org.apache.flink.core.memory.MemorySegment current,
                                                                         int posInSegment)
                                                                  throws IOException
        Description copied from class: AbstractPagedOutputView
        This method must return a segment. If no more segments are available, it must throw an EOFException.
        Specified by:
        nextSegment in class AbstractPagedOutputView
        Parameters:
        current - The current memory segment
        posInSegment - The position in the segment, one after the last valid byte.
        Returns:
        The next memory segment.
        Throws:
        IOException