Package com.mapr.fs

Class MapRFsInStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.fs.FSInputStream
com.mapr.fs.MapRFsInStream
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.fs.ByteBufferReadable, org.apache.hadoop.fs.CanSetDropBehind, org.apache.hadoop.fs.CanSetReadahead, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable

public class MapRFsInStream extends org.apache.hadoop.fs.FSInputStream implements org.apache.hadoop.fs.ByteBufferReadable, org.apache.hadoop.fs.CanSetReadahead, org.apache.hadoop.fs.CanSetDropBehind
  • Field Details

    • LOG

      public static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • MapRFsInStream

      protected MapRFsInStream(long clntPtr, long filePtr, String filename, org.apache.hadoop.fs.FileSystem.Statistics stats, com.mapr.fs.jni.InodeAttributes attr, com.mapr.fs.jni.MapRUserInfo userInfo) throws IOException
      Throws:
      IOException
    • MapRFsInStream

      public MapRFsInStream(long clntPtr, long filePtr, String filename, org.apache.hadoop.fs.FileSystem.Statistics stats, com.mapr.fs.jni.MapRUserInfo userInfo) throws IOException
      Throws:
      IOException
  • Method Details

    • getFidStr

      public String getFidStr()
    • getFidServers

      public long[] getFidServers()
    • getChunkSize

      public long getChunkSize()
    • openAndRead

      public void openAndRead(org.apache.hadoop.fs.PathId pfid, String file, int length) throws IOException
      Throws:
      IOException
    • getCacheSize

      public int getCacheSize(com.mapr.fs.jni.InodeAttributes iattr)
    • getPos

      public long getPos()
      Specified by:
      getPos in interface org.apache.hadoop.fs.Seekable
      Specified by:
      getPos in class org.apache.hadoop.fs.FSInputStream
    • getFileLength

      public long getFileLength()
    • available

      public int available() throws IOException
      Overrides:
      available in class InputStream
      Throws:
      IOException
    • seekToNewSource

      public boolean seekToNewSource(long pos)
      Specified by:
      seekToNewSource in interface org.apache.hadoop.fs.Seekable
      Specified by:
      seekToNewSource in class org.apache.hadoop.fs.FSInputStream
    • read

      public int read(byte[] buffer, int bufOffset, int length) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • read

      public int read(ByteBuffer buf) throws IOException
      Specified by:
      read in interface org.apache.hadoop.fs.ByteBufferReadable
      Throws:
      IOException
    • read

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

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

      public int read(long startPos, byte[] buffer, int bufOffset, int length) throws IOException
      Specified by:
      read in interface org.apache.hadoop.fs.PositionedReadable
      Overrides:
      read in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • readFully

      public void readFully(long pos, byte[] buffer) throws IOException
      Specified by:
      readFully in interface org.apache.hadoop.fs.PositionedReadable
      Overrides:
      readFully in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • readFully

      public void readFully(long pos, byte[] buffer, int bufOffset, int length) throws IOException
      Specified by:
      readFully in interface org.apache.hadoop.fs.PositionedReadable
      Overrides:
      readFully in class org.apache.hadoop.fs.FSInputStream
      Throws:
      IOException
    • adviseFile

      public void adviseFile(org.apache.hadoop.fs.FSDataInputStream.FadviseType type, long offset, long count) throws IOException
      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
    • setReadahead

      public void setReadahead(Long readAhead)
      Specified by:
      setReadahead in interface org.apache.hadoop.fs.CanSetReadahead
    • setDropBehind

      public void setDropBehind(Boolean dropBehind)
      Specified by:
      setDropBehind in interface org.apache.hadoop.fs.CanSetDropBehind