Class 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 a WrappingProxy for FSDataInputStream 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 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 class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • read

        public int read​(byte[] b)
                 throws IOException
        Overrides:
        read in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws IOException
        Overrides:
        read in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • seek

        public void seek​(long desired)
                  throws IOException
        Overrides:
        seek in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • getPos

        public long getPos()
                    throws IOException
        Overrides:
        getPos in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • skip

        public long skip​(long n)
                  throws IOException
        Overrides:
        skip in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • mark

        public void mark​(int readlimit)
        Overrides:
        mark in class org.apache.flink.core.fs.FSDataInputStreamWrapper
      • reset

        public void reset()
                   throws IOException
        Overrides:
        reset in class org.apache.flink.core.fs.FSDataInputStreamWrapper
        Throws:
        IOException
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class org.apache.flink.core.fs.FSDataInputStreamWrapper