Package com.mapr.fs
Class MapRFsInStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.hadoop.fs.FSInputStream
-
- com.mapr.fs.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.LogLOG
-
Constructor Summary
Constructors Modifier Constructor Description protectedMapRFsInStream(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 voidadviseFile(org.apache.hadoop.fs.FSDataInputStream.FadviseType type, long offset, long count)intavailable()voidclose()intgetCacheSize(com.mapr.fs.jni.InodeAttributes iattr)longgetChunkSize()long[]getFidServers()java.lang.StringgetFidStr()longgetFileLength()longgetPos()voidopenAndRead(org.apache.hadoop.fs.PathId pfid, java.lang.String file, int length)intread()intread(byte[] buffer, int bufOffset, int length)intread(long startPos, byte[] buffer, int bufOffset, int length)intread(java.nio.ByteBuffer buf)voidreadFully(long pos, byte[] buffer)voidreadFully(long pos, byte[] buffer, int bufOffset, int length)voidseek(long pos)booleanseekToNewSource(long pos)voidsetDropBehind(java.lang.Boolean dropBehind)voidsetReadahead(java.lang.Long readAhead)-
Methods inherited from class org.apache.hadoop.fs.FSInputStream
toString, validatePositionedReadArgs
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
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:
getPosin interfaceorg.apache.hadoop.fs.Seekable- Specified by:
getPosin classorg.apache.hadoop.fs.FSInputStream
-
getFileLength
public long getFileLength()
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
seekToNewSource
public boolean seekToNewSource(long pos)
- Specified by:
seekToNewSourcein interfaceorg.apache.hadoop.fs.Seekable- Specified by:
seekToNewSourcein classorg.apache.hadoop.fs.FSInputStream
-
read
public int read(byte[] buffer, int bufOffset, int length) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(java.nio.ByteBuffer buf) throws java.io.IOException- Specified by:
readin interfaceorg.apache.hadoop.fs.ByteBufferReadable- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException- Specified by:
seekin interfaceorg.apache.hadoop.fs.Seekable- Specified by:
seekin classorg.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:
readin interfaceorg.apache.hadoop.fs.PositionedReadable- Overrides:
readin classorg.apache.hadoop.fs.FSInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(long pos, byte[] buffer) throws java.io.IOException- Specified by:
readFullyin interfaceorg.apache.hadoop.fs.PositionedReadable- Overrides:
readFullyin classorg.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:
readFullyin interfaceorg.apache.hadoop.fs.PositionedReadable- Overrides:
readFullyin classorg.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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
setReadahead
public void setReadahead(java.lang.Long readAhead)
- Specified by:
setReadaheadin interfaceorg.apache.hadoop.fs.CanSetReadahead
-
setDropBehind
public void setDropBehind(java.lang.Boolean dropBehind)
- Specified by:
setDropBehindin interfaceorg.apache.hadoop.fs.CanSetDropBehind
-
-