public final class CompressedHeaderlessChannelWriterOutputView extends AbstractChannelWriterOutputView implements BufferRecycler
DataOutputView
that is backed by a FileIOChannel
,
making it effectively a data output stream. The view will compress its data before writing it in
blocks to the underlying channel.headerLength, segmentSize
Constructor and Description |
---|
CompressedHeaderlessChannelWriterOutputView(BufferFileWriter writer,
BlockCompressionFactory compressionCodecFactory,
int compressionBlockSize) |
Modifier and Type | Method and Description |
---|---|
int |
close()
Closes this OutputView, closing the underlying writer
|
int |
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 the
MemorySegment to its original BufferPool instance. |
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getHeaderLength, getSegmentSize, seekOutput, skipBytesToWrite, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public CompressedHeaderlessChannelWriterOutputView(BufferFileWriter writer, BlockCompressionFactory compressionCodecFactory, int compressionBlockSize)
public FileIOChannel getChannel()
AbstractChannelWriterOutputView
getChannel
in class AbstractChannelWriterOutputView
public int close() throws IOException
AbstractChannelWriterOutputView
close
in class AbstractChannelWriterOutputView
IOException
protected MemorySegment nextSegment(MemorySegment current, int positionInCurrent) throws IOException
AbstractPagedOutputView
EOFException
.nextSegment
in class AbstractPagedOutputView
current
- The current memory segmentpositionInCurrent
- The position in the segment, one after the last valid byte.IOException
public long getNumBytes()
AbstractChannelWriterOutputView
getNumBytes
in class AbstractChannelWriterOutputView
public long getNumCompressedBytes()
AbstractChannelWriterOutputView
getNumCompressedBytes
in class AbstractChannelWriterOutputView
public int getBlockCount()
AbstractChannelWriterOutputView
getBlockCount
in class AbstractChannelWriterOutputView
public void recycle(MemorySegment memorySegment)
BufferRecycler
MemorySegment
to its original BufferPool
instance.recycle
in interface BufferRecycler
memorySegment
- The memory segment to be recycled.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.