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 void
close()
void
closeAndDelete()
void
deleteChannel()
org.apache.flink.runtime.io.disk.iomanager.FileIOChannel.ID
getChannelID()
org.apache.flink.core.memory.MemorySegment
getNextReturnedBlock()
FileChannel
getNioFileChannel()
LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment>
getReturnQueue()
long
getSize()
boolean
isClosed()
void
recycle(org.apache.flink.core.memory.MemorySegment memorySegment)
void
writeBlock(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:
writeBlock
in 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:
getChannelID
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
getSize
public long getSize() throws IOException
- Specified by:
getSize
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
- Throws:
IOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
close
public void close() throws IOException
- Specified by:
close
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
- Throws:
IOException
-
deleteChannel
public void deleteChannel()
- Specified by:
deleteChannel
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
closeAndDelete
public void closeAndDelete() throws IOException
- Specified by:
closeAndDelete
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
- Throws:
IOException
-
getNioFileChannel
public FileChannel getNioFileChannel()
- Specified by:
getNioFileChannel
in interfaceorg.apache.flink.runtime.io.disk.iomanager.FileIOChannel
-
recycle
public void recycle(org.apache.flink.core.memory.MemorySegment memorySegment)
- Specified by:
recycle
in interfaceorg.apache.flink.runtime.io.network.buffer.BufferRecycler
-
getNextReturnedBlock
public org.apache.flink.core.memory.MemorySegment getNextReturnedBlock() throws IOException
- Specified by:
getNextReturnedBlock
in 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:
getReturnQueue
in interfaceorg.apache.flink.runtime.io.disk.iomanager.BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>
-
-