Class CompressedHeaderlessChannelWriterOutputView
- java.lang.Object
-
- org.apache.flink.runtime.memory.AbstractPagedOutputView
-
- org.apache.flink.runtime.io.disk.iomanager.AbstractChannelWriterOutputView
-
- org.apache.flink.table.runtime.io.CompressedHeaderlessChannelWriterOutputView
-
- All Implemented Interfaces:
DataOutput
,DataOutputView
,MemorySegmentWritable
,BufferRecycler
public final class CompressedHeaderlessChannelWriterOutputView extends AbstractChannelWriterOutputView implements BufferRecycler
ADataOutputView
that is backed by aFileIOChannel
, making it effectively a data output stream. The view will compress its data before writing it in blocks to the underlying channel.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
BufferRecycler.DummyBufferRecycler
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.memory.AbstractPagedOutputView
headerLength, segmentSize
-
-
Constructor Summary
Constructors Constructor Description CompressedHeaderlessChannelWriterOutputView(BufferFileWriter writer, BlockCompressionFactory compressionCodecFactory, int compressionBlockSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
close()
Closes this OutputView, closing the underlying writerint
getBlockCount()
Gets the number of blocks used by this view.FileIOChannel
getChannel()
Get the underlying channel.long
getNumBytes()
Get output bytes.long
getNumCompressedBytes()
Get output compressed bytes, return num bytes if there is no compression.protected MemorySegment
nextSegment(MemorySegment current, int positionInCurrent)
This method must return a segment.void
recycle(MemorySegment memorySegment)
Recycles theMemorySegment
to its originalBufferPool
instance.-
Methods inherited from class org.apache.flink.runtime.memory.AbstractPagedOutputView
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getHeaderLength, getSegmentSize, seekOutput, skipBytesToWrite, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Constructor Detail
-
CompressedHeaderlessChannelWriterOutputView
public CompressedHeaderlessChannelWriterOutputView(BufferFileWriter writer, BlockCompressionFactory compressionCodecFactory, int compressionBlockSize)
-
-
Method Detail
-
getChannel
public FileIOChannel getChannel()
Description copied from class:AbstractChannelWriterOutputView
Get the underlying channel.- Specified by:
getChannel
in classAbstractChannelWriterOutputView
-
close
public int close() throws IOException
Description copied from class:AbstractChannelWriterOutputView
Closes this OutputView, closing the underlying writer- Specified by:
close
in classAbstractChannelWriterOutputView
- Returns:
- the number of bytes in last memory segment.
- Throws:
IOException
-
nextSegment
protected MemorySegment nextSegment(MemorySegment current, int positionInCurrent) throws IOException
Description copied from class:AbstractPagedOutputView
This method must return a segment. If no more segments are available, it must throw anEOFException
.- Specified by:
nextSegment
in classAbstractPagedOutputView
- Parameters:
current
- The current memory segmentpositionInCurrent
- The position in the segment, one after the last valid byte.- Returns:
- The next memory segment.
- Throws:
IOException
-
getNumBytes
public long getNumBytes()
Description copied from class:AbstractChannelWriterOutputView
Get output bytes.- Specified by:
getNumBytes
in classAbstractChannelWriterOutputView
-
getNumCompressedBytes
public long getNumCompressedBytes()
Description copied from class:AbstractChannelWriterOutputView
Get output compressed bytes, return num bytes if there is no compression.- Specified by:
getNumCompressedBytes
in classAbstractChannelWriterOutputView
-
getBlockCount
public int getBlockCount()
Description copied from class:AbstractChannelWriterOutputView
Gets the number of blocks used by this view.- Specified by:
getBlockCount
in classAbstractChannelWriterOutputView
-
recycle
public void recycle(MemorySegment memorySegment)
Description copied from interface:BufferRecycler
Recycles theMemorySegment
to its originalBufferPool
instance.- Specified by:
recycle
in interfaceBufferRecycler
- Parameters:
memorySegment
- The memory segment to be recycled.
-
-