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.
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcloseAndDelete()voiddeleteChannel()org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.IDgetChannelID()org.apache.flink.core.memory.MemorySegmentgetNextReturnedBlock()FileChannelgetNioFileChannel()LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment>getReturnQueue()longgetSize()booleanisClosed()voidrecycle(org.apache.flink.core.memory.MemorySegment memorySegment)voidwriteBlock(org.apache.flink.core.memory.MemorySegment block)
-
-
-
Constructor Detail
-
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 Detail
-
writeBlock
public void writeBlock(org.apache.flink.core.memory.MemorySegment block) throws IOException- Specified by:
writeBlockin interfaceorg.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:
getChannelIDin interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
getSize
public long getSize() throws IOException- Specified by:
getSizein interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel- Throws:
IOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
close
public void close() throws IOException- Specified by:
closein interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel- Throws:
IOException
-
deleteChannel
public void deleteChannel()
- Specified by:
deleteChannelin interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
closeAndDelete
public void closeAndDelete() throws IOException- Specified by:
closeAndDeletein interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel- Throws:
IOException
-
getNioFileChannel
public FileChannel getNioFileChannel()
- Specified by:
getNioFileChannelin interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
recycle
public void recycle(org.apache.flink.core.memory.MemorySegment memorySegment)
- Specified by:
recyclein interfaceorg.apache.flink.runtime.io.network.buffer.BufferRecycler
-
getNextReturnedBlock
public org.apache.flink.core.memory.MemorySegment getNextReturnedBlock() throws IOException- Specified by:
getNextReturnedBlockin interfaceorg.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:
getReturnQueuein interfaceorg.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>
-
-