public abstract class AbstractPagedInputView extends Object implements org.apache.flink.core.memory.DataInputView
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
headerLength |
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractPagedInputView(int headerLength)
Creates a new view that is initially not bound to a memory segment.
|
protected |
AbstractPagedInputView(org.apache.flink.core.memory.MemorySegment initialSegment,
int initialLimit,
int headerLength)
Creates a new view that starts with the given segment.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
advance()
Advances the view to the next memory segment.
|
protected void |
clear()
Clears the internal state of the view.
|
protected void |
doAdvance() |
int |
getCurrentPositionInSegment()
Gets the position from which the next byte will be read.
|
org.apache.flink.core.memory.MemorySegment |
getCurrentSegment()
Gets the memory segment that will be used to read the next bytes from.
|
int |
getCurrentSegmentLimit()
Gets the current limit in the memory segment.
|
int |
getHeaderLength() |
protected abstract int |
getLimitForSegment(org.apache.flink.core.memory.MemorySegment segment)
Gets the limit for reading bytes from the given memory segment.
|
protected abstract org.apache.flink.core.memory.MemorySegment |
nextSegment(org.apache.flink.core.memory.MemorySegment current)
The method by which concrete subclasses realize page crossing.
|
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
protected void |
seekInput(org.apache.flink.core.memory.MemorySegment segment,
int positionInSegment,
int limitInSegment)
Sets the internal state of the view such that the next bytes will be read from the given
memory segment, starting at the given position.
|
int |
skipBytes(int n) |
void |
skipBytesToRead(int numBytes) |
protected AbstractPagedInputView(org.apache.flink.core.memory.MemorySegment initialSegment,
int initialLimit,
int headerLength)
initialSegment - The memory segment to start reading from.initialLimit - The position one after the last valid byte in the initial segment.headerLength - The number of bytes to skip at the beginning of each segment for the
header. This length must be the same for all memory segments.protected AbstractPagedInputView(int headerLength)
WARNING: The view is not readable until the first call to either advance(), or to
seekInput(MemorySegment, int, int).
headerLength - The number of bytes to skip at the beginning of each segment for the
header.public org.apache.flink.core.memory.MemorySegment getCurrentSegment()
nextSegment(MemorySegment) method.public int getCurrentPositionInSegment()
getCurrentSegmentLimit()public int getCurrentSegmentLimit()
getCurrentPositionInSegment()protected abstract org.apache.flink.core.memory.MemorySegment nextSegment(org.apache.flink.core.memory.MemorySegment current)
throws EOFException,
IOException
EOFException.current - 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 abstract int getLimitForSegment(org.apache.flink.core.memory.MemorySegment segment)
segment - The segment to determine the limit for.public void advance()
throws IOException
nextSegment(MemorySegment) and getLimitForSegment(MemorySegment) to get the next segment and set its limit.IOException - Thrown, if the next segment could not be obtained.nextSegment(MemorySegment),
getLimitForSegment(MemorySegment)protected void doAdvance()
throws IOException
IOExceptionpublic int getHeaderLength()
protected void seekInput(org.apache.flink.core.memory.MemorySegment segment,
int positionInSegment,
int limitInSegment)
segment - The segment to read the next bytes from.positionInSegment - The position in the segment to start reading from.limitInSegment - The limit in the segment. When reached, the view will attempt to switch
to the next segment.protected void clear()
advance() or seekInput(MemorySegment, int, int) method have been
invoked.public int read(byte[] b)
throws IOException
read 在接口中 org.apache.flink.core.memory.DataInputViewIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在接口中 org.apache.flink.core.memory.DataInputViewIOExceptionpublic void readFully(byte[] b)
throws IOException
readFully 在接口中 DataInputIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully 在接口中 DataInputIOExceptionpublic boolean readBoolean()
throws IOException
readBoolean 在接口中 DataInputIOExceptionpublic byte readByte()
throws IOException
readByte 在接口中 DataInputIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte 在接口中 DataInputIOExceptionpublic short readShort()
throws IOException
readShort 在接口中 DataInputIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort 在接口中 DataInputIOExceptionpublic char readChar()
throws IOException
readChar 在接口中 DataInputIOExceptionpublic int readInt()
throws IOException
readInt 在接口中 DataInputIOExceptionpublic long readLong()
throws IOException
readLong 在接口中 DataInputIOExceptionpublic float readFloat()
throws IOException
readFloat 在接口中 DataInputIOExceptionpublic double readDouble()
throws IOException
readDouble 在接口中 DataInputIOExceptionpublic String readLine() throws IOException
readLine 在接口中 DataInputIOExceptionpublic String readUTF() throws IOException
readUTF 在接口中 DataInputIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes 在接口中 DataInputIOExceptionpublic void skipBytesToRead(int numBytes)
throws IOException
skipBytesToRead 在接口中 org.apache.flink.core.memory.DataInputViewIOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.