public class HdfsFileInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
Constructor and Description |
---|
HdfsFileInputStream(TachyonFS tfs,
long fileId,
org.apache.hadoop.fs.Path hdfsPath,
org.apache.hadoop.conf.Configuration conf,
int bufferSize,
org.apache.hadoop.fs.FileSystem.Statistics stats,
TachyonConf tachyonConf) |
Modifier and Type | Method and Description |
---|---|
int |
available()
This method is not supported in
HdfsFileInputStream . |
void |
close() |
long |
getPos() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer)
This method is not supported in
HdfsFileInputStream . |
void |
readFully(long position,
byte[] buffer,
int offset,
int length)
This method is not supported in
HdfsFileInputStream . |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos)
This method is not supported in
HdfsFileInputStream . |
mark, markSupported, reset, skip
public HdfsFileInputStream(TachyonFS tfs, long fileId, org.apache.hadoop.fs.Path hdfsPath, org.apache.hadoop.conf.Configuration conf, int bufferSize, org.apache.hadoop.fs.FileSystem.Statistics stats, TachyonConf tachyonConf) throws IOException
tfs
- the TachyonFSfileId
- the file idhdfsPath
- the HDFS pathconf
- Hadoop configurationbufferSize
- the buffer sizestats
- filesystem statisticstachyonConf
- Tachyon configurationIOException
- if the underlying file does not exist or its stream cannot be createdpublic int available() throws IOException
HdfsFileInputStream
.available
in class InputStream
IOException
- alwayspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public long getPos() throws IOException
getPos
in interface org.apache.hadoop.fs.Seekable
IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
read
in interface org.apache.hadoop.fs.PositionedReadable
IOException
public void readFully(long position, byte[] buffer) throws IOException
HdfsFileInputStream
.readFully
in interface org.apache.hadoop.fs.PositionedReadable
IOException
- alwayspublic void readFully(long position, byte[] buffer, int offset, int length) throws IOException
HdfsFileInputStream
.readFully
in interface org.apache.hadoop.fs.PositionedReadable
IOException
- alwayspublic void seek(long pos) throws IOException
seek
in interface org.apache.hadoop.fs.Seekable
IOException
public boolean seekToNewSource(long targetPos) throws IOException
HdfsFileInputStream
.seekToNewSource
in interface org.apache.hadoop.fs.Seekable
IOException
- alwaysCopyright © 2015. All Rights Reserved.