Class CompressedBlockChannelWriter

java.lang.Object
org.apache.flink.table.runtime.io.CompressedBlockChannelWriter
All Implemented Interfaces:
org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>, org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriterWithCallback<org.apache.flink.core.memory.MemorySegment>, org.apache.flink.runtime.io.disk.iomanager.FileIOChannel, org.apache.flink.runtime.io.network.buffer.BufferRecycler

public class CompressedBlockChannelWriter extends Object implements org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>, org.apache.flink.runtime.io.network.buffer.BufferRecycler
Compressed block channel writer provides a scenario where MemorySegment must be maintained.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler

    org.apache.flink.runtime.io.network.buffer.BufferRecycler.DummyBufferRecycler

    Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel

    org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.Enumerator, org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompressedBlockChannelWriter(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID channel, LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> blockQueue, org.apache.flink.runtime.io.compression.BlockCompressionFactory codecFactory, int preferBlockSize, int segmentSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID
     
    org.apache.flink.core.memory.MemorySegment
     
     
    LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment>
     
    long
     
    boolean
     
    void
    recycle(org.apache.flink.core.memory.MemorySegment memorySegment)
     
    void
    writeBlock(org.apache.flink.core.memory.MemorySegment block)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompressedBlockChannelWriter

      public CompressedBlockChannelWriter(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID channel, LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> blockQueue, org.apache.flink.runtime.io.compression.BlockCompressionFactory codecFactory, int preferBlockSize, int segmentSize) throws IOException
      Throws:
      IOException
  • Method Details

    • writeBlock

      public void writeBlock(org.apache.flink.core.memory.MemorySegment block) throws IOException
      Specified by:
      writeBlock in interface org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriterWithCallback<org.apache.flink.core.memory.MemorySegment>
      Throws:
      IOException
    • getChannelID

      public org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID getChannelID()
      Specified by:
      getChannelID in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
    • getSize

      public long getSize() throws IOException
      Specified by:
      getSize in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
      Throws:
      IOException
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
    • close

      public void close() throws IOException
      Specified by:
      close in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
      Throws:
      IOException
    • deleteChannel

      public void deleteChannel()
      Specified by:
      deleteChannel in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
    • closeAndDelete

      public void closeAndDelete() throws IOException
      Specified by:
      closeAndDelete in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
      Throws:
      IOException
    • getNioFileChannel

      public FileChannel getNioFileChannel()
      Specified by:
      getNioFileChannel in interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
    • recycle

      public void recycle(org.apache.flink.core.memory.MemorySegment memorySegment)
      Specified by:
      recycle in interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
    • getNextReturnedBlock

      public org.apache.flink.core.memory.MemorySegment getNextReturnedBlock() throws IOException
      Specified by:
      getNextReturnedBlock in interface org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>
      Throws:
      IOException
    • getReturnQueue

      public LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> getReturnQueue()
      Specified by:
      getReturnQueue in interface org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>