Class FsSegmentDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- org.apache.flink.core.fs.FSDataInputStreamWrapper
-
- org.apache.flink.runtime.state.filesystem.FsSegmentDataInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.flink.core.fs.WrappingProxyCloseable<org.apache.flink.core.fs.FSDataInputStream>
,org.apache.flink.util.WrappingProxy<org.apache.flink.core.fs.FSDataInputStream>
public class FsSegmentDataInputStream extends org.apache.flink.core.fs.FSDataInputStreamWrapper implements org.apache.flink.core.fs.WrappingProxyCloseable<org.apache.flink.core.fs.FSDataInputStream>
This class is aWrappingProxy
forFSDataInputStream
that is used to read from a file segment. It is opened with a starting position of the file. It treats the argument of seek(long) as an offset relative to the starting position, rather than an absolute value.
-
-
Constructor Summary
Constructors Constructor Description FsSegmentDataInputStream(org.apache.flink.core.fs.FSDataInputStream inputStream, long startingPosition, long segmentSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getPos()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
void
seek(long desired)
long
skip(long n)
-
Methods inherited from class org.apache.flink.core.fs.FSDataInputStreamWrapper
available, close, getWrappedDelegate
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
FsSegmentDataInputStream
public FsSegmentDataInputStream(org.apache.flink.core.fs.FSDataInputStream inputStream, long startingPosition, long segmentSize) throws IOException
- Throws:
IOException
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
seek
public void seek(long desired) throws IOException
- Overrides:
seek
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
getPos
public long getPos() throws IOException
- Overrides:
getPos
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
-
reset
public void reset() throws IOException
- Overrides:
reset
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classorg.apache.flink.core.fs.FSDataInputStreamWrapper
-
-