public final class ChannelWriterOutputView extends AbstractPagedOutputView implements Closeable
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.currentSegment, segmentSize
Constructor and Description |
---|
ChannelWriterOutputView(BufferFileWriter writer,
BlockCompressionFactory compressionCodecFactory,
int compressionBlockSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeAndDelete() |
int |
getBlockCount() |
FileIOChannel |
getChannel() |
long |
getNumBytes() |
long |
getNumCompressedBytes() |
long |
getWriteBytes() |
protected MemorySegment |
nextSegment(MemorySegment current,
int positionInCurrent)
This method must return a segment.
|
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getSegmentSize, seekOutput, skipBytesToWrite, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public ChannelWriterOutputView(BufferFileWriter writer, BlockCompressionFactory compressionCodecFactory, int compressionBlockSize)
public FileIOChannel getChannel()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void closeAndDelete() throws IOException
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()
public long getNumCompressedBytes()
public long getWriteBytes()
public int getBlockCount()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.