Package org.apache.flink.runtime.io.disk
Class SeekableFileChannelInputView
java.lang.Object
org.apache.flink.runtime.memory.AbstractPagedInputView
org.apache.flink.runtime.io.disk.SeekableFileChannelInputView
- All Implemented Interfaces:
DataInput,org.apache.flink.core.memory.DataInputView
A
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.-
Field Summary
Fields inherited from class org.apache.flink.runtime.memory.AbstractPagedInputView
headerLength -
Constructor Summary
ConstructorsConstructorDescriptionSeekableFileChannelInputView(IOManager ioManager, FileIOChannel.ID channelId, MemoryManager memManager, List<org.apache.flink.core.memory.MemorySegment> memory, int sizeOfLastBlock) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidprotected intgetLimitForSegment(org.apache.flink.core.memory.MemorySegment segment) Gets the limit for reading bytes from the given memory segment.protected org.apache.flink.core.memory.MemorySegmentnextSegment(org.apache.flink.core.memory.MemorySegment current) The method by which concrete subclasses realize page crossing.voidseek(long position) Methods inherited from class org.apache.flink.runtime.memory.AbstractPagedInputView
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, skipBytesToRead
-
Constructor Details
-
SeekableFileChannelInputView
public SeekableFileChannelInputView(IOManager ioManager, FileIOChannel.ID channelId, MemoryManager memManager, List<org.apache.flink.core.memory.MemorySegment> memory, int sizeOfLastBlock) throws IOException - Throws:
IOException
-
-
Method Details
-
seek
- Throws:
IOException
-
close
- Throws:
IOException
-
closeAndDelete
- Throws:
IOException
-
nextSegment
protected org.apache.flink.core.memory.MemorySegment nextSegment(org.apache.flink.core.memory.MemorySegment current) throws IOException Description copied from class:AbstractPagedInputViewThe method by which concrete subclasses realize page crossing. This method is invoked when the current page is exhausted and a new page is required to continue the reading. If no further page is available, this method must throw anEOFException.- Specified by:
nextSegmentin classAbstractPagedInputView- Parameters:
current- The current page that was read to its limit. May benull, if this method is invoked for the first time.- Returns:
- The next page from which the reading should continue. May not be
null. If the input is exhausted, anEOFExceptionmust be thrown instead. - Throws:
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.
-
getLimitForSegment
protected int getLimitForSegment(org.apache.flink.core.memory.MemorySegment segment) Description copied from class:AbstractPagedInputViewGets the limit for reading bytes from the given memory segment. This method must return the position of the byte after the last valid byte in the given memory segment. When the position returned by this method is reached, the view will attempt to switch to the next memory segment.- Specified by:
getLimitForSegmentin classAbstractPagedInputView- Parameters:
segment- The segment to determine the limit for.- Returns:
- The limit for the given memory segment.
-