Class WebHdfsFileSystem.WebHdfsInputStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.fs.FSInputStream
org.apache.hadoop.hdfs.web.WebHdfsFileSystem.WebHdfsInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable
Enclosing class:
WebHdfsFileSystem

@VisibleForTesting public class WebHdfsFileSystem.WebHdfsInputStream extends org.apache.hadoop.fs.FSInputStream
This class is used for opening, reading, and seeking files while using the WebHdfsFileSystem. This class will invoke the retry policy when performing any of these actions.
  • Method Details

    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • seek

      public void seek(long newPos) throws IOException
      Specified by:
      seek in interface org.apache.hadoop.fs.Seekable
      Specified by:
      seek in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • getPos

      public long getPos() throws IOException
      Specified by:
      getPos in interface org.apache.hadoop.fs.Seekable
      Specified by:
      getPos in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • getBufferSize

      protected int getBufferSize() throws IOException
      Throws:
      IOException
    • getPath

      protected org.apache.hadoop.fs.Path getPath() throws IOException
      Throws:
      IOException
    • seekToNewSource

      public boolean seekToNewSource(long targetPos) throws IOException
      Specified by:
      seekToNewSource in interface org.apache.hadoop.fs.Seekable
      Specified by:
      seekToNewSource in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException
    • setFileLength

      public void setFileLength(long len)
    • getFileLength

      public long getFileLength()