public class SeekableFileChannelInputView extends AbstractPagedInputView
DataInputView that is backed by a BlockChannelReader,
making it effectively a data input stream. The view reads it data in blocks from the underlying channel.
The view can read data that has been written by a FileChannelOutputView, or that was written in blocks
in another fashion.headerLength| Constructor and Description |
|---|
SeekableFileChannelInputView(IOManager ioManager,
FileIOChannel.ID channelId,
MemoryManager memManager,
List<org.apache.flink.core.memory.MemorySegment> memory,
int sizeOfLastBlock) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeAndDelete() |
protected int |
getLimitForSegment(org.apache.flink.core.memory.MemorySegment segment)
Gets the limit for reading bytes from the given memory segment.
|
protected org.apache.flink.core.memory.MemorySegment |
nextSegment(org.apache.flink.core.memory.MemorySegment current)
The method by which concrete subclasses realize page crossing.
|
void |
seek(long position) |
advance, clear, doAdvance, getCurrentPositionInSegment, getCurrentSegment, getCurrentSegmentLimit, getHeaderLength, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seekInput, skipBytes, skipBytesToReadpublic SeekableFileChannelInputView(IOManager ioManager, FileIOChannel.ID channelId, MemoryManager memManager, List<org.apache.flink.core.memory.MemorySegment> memory, int sizeOfLastBlock) throws IOException
IOExceptionpublic void seek(long position)
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void closeAndDelete()
throws IOException
IOExceptionprotected org.apache.flink.core.memory.MemorySegment nextSegment(org.apache.flink.core.memory.MemorySegment current)
throws IOException
AbstractPagedInputViewEOFException.nextSegment in class AbstractPagedInputViewcurrent - The current page that was read to its limit. May be null, if this method is
invoked for the first time.null. If the input is
exhausted, an EOFException must be thrown instead.EOFException - Thrown, if no further segment is available.IOException - Thrown, if the method cannot provide the next page due to an I/O related problem.protected int getLimitForSegment(org.apache.flink.core.memory.MemorySegment segment)
AbstractPagedInputViewgetLimitForSegment in class AbstractPagedInputViewsegment - The segment to determine the limit for.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.