public class FileChannelOutputView extends AbstractPagedOutputView
DataOutputView
that is backed by a BlockChannelWriter
, making it effectively a data output
stream. The view writes it data in blocks to the underlying channel.headerLength, segmentSize
Constructor and Description |
---|
FileChannelOutputView(BlockChannelWriter<MemorySegment> writer,
MemoryManager memManager,
List<MemorySegment> memory,
int segmentSize) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output, writing pending data and releasing the memory.
|
void |
closeAndDelete()
Closes this output, writing pending data and releasing the memory.
|
int |
getBlockCount()
Gets the number of blocks written by this output view.
|
int |
getBytesInLatestSegment()
Gets the number of bytes written in the latest memory segment.
|
long |
getWriteOffset() |
protected MemorySegment |
nextSegment(MemorySegment current,
int posInSegment)
This method must return a segment.
|
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 FileChannelOutputView(BlockChannelWriter<MemorySegment> writer, MemoryManager memManager, List<MemorySegment> memory, int segmentSize) throws IOException
IOException
public void close() throws IOException
IOException
- Thrown, if the pending data could not be written.public void closeAndDelete() throws IOException
IOException
- Thrown, if the pending data could not be written.public int getBlockCount()
public int getBytesInLatestSegment()
public long getWriteOffset()
protected MemorySegment nextSegment(MemorySegment current, int posInSegment) throws IOException
AbstractPagedOutputView
EOFException
.nextSegment
in class AbstractPagedOutputView
current
- The current memory segmentposInSegment
- The position in the segment, one after the last valid byte.IOException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.