Package com.mapr.fs

Class MapRFsInStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.commons.logging.Log LOG  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MapRFsInStream​(long clntPtr, long filePtr, java.lang.String filename, org.apache.hadoop.fs.FileSystem.Statistics stats, com.mapr.fs.jni.InodeAttributes attr, com.mapr.fs.jni.MapRUserInfo userInfo)  
        MapRFsInStream​(long clntPtr, long filePtr, java.lang.String filename, org.apache.hadoop.fs.FileSystem.Statistics stats, com.mapr.fs.jni.MapRUserInfo userInfo)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void adviseFile​(org.apache.hadoop.fs.FSDataInputStream.FadviseType type, long offset, long count)  
      int available()  
      void close()  
      int getCacheSize​(com.mapr.fs.jni.InodeAttributes iattr)  
      long getChunkSize()  
      long[] getFidServers()  
      java.lang.String getFidStr()  
      long getFileLength()  
      long getPos()  
      void openAndRead​(org.apache.hadoop.fs.PathId pfid, java.lang.String file, int length)  
      int read()  
      int read​(byte[] buffer, int bufOffset, int length)  
      int read​(long startPos, byte[] buffer, int bufOffset, int length)  
      int read​(java.nio.ByteBuffer buf)  
      void readFully​(long pos, byte[] buffer)  
      void readFully​(long pos, byte[] buffer, int bufOffset, int length)  
      void seek​(long pos)  
      boolean seekToNewSource​(long pos)  
      void setDropBehind​(java.lang.Boolean dropBehind)  
      void setReadahead​(java.lang.Long readAhead)  
      • Methods inherited from class java.io.InputStream

        mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

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

      • MapRFsInStream

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

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

      • getFidStr

        public java.lang.String getFidStr()
      • getFidServers

        public long[] getFidServers()
      • getChunkSize

        public long getChunkSize()
      • openAndRead

        public void openAndRead​(org.apache.hadoop.fs.PathId pfid,
                                java.lang.String file,
                                int length)
                         throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.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 java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

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

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

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

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

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

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

        public void adviseFile​(org.apache.hadoop.fs.FSDataInputStream.FadviseType type,
                               long offset,
                               long count)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • setReadahead

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

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