org.apache.hadoop.hbase.io
Class BlockFSInputStream
java.lang.Object
java.io.InputStream
org.apache.hadoop.fs.FSInputStream
org.apache.hadoop.hbase.io.BlockFSInputStream
- All Implemented Interfaces:
- Closeable, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable
public class BlockFSInputStream
- extends org.apache.hadoop.fs.FSInputStream
An implementation of FSInputStream
that reads the stream in blocks
of a fixed, configurable size. The blocks are stored in a memory-sensitive cache.
Methods inherited from class org.apache.hadoop.fs.FSInputStream |
read, readFully, readFully |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockFSInputStream
public BlockFSInputStream(InputStream in,
long fileLength,
int blockSize)
- Parameters:
in
- fileLength
- blockSize
- the size of each block in bytes.
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
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
seek
public void seek(long targetPos)
throws IOException
- Specified by:
seek
in interface org.apache.hadoop.fs.Seekable
- Specified by:
seek
in class org.apache.hadoop.fs.FSInputStream
- 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
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
read
public int read(byte[] buf,
int off,
int len)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
markSupported
public boolean markSupported()
- We don't support marks.
- Overrides:
markSupported
in class InputStream
mark
public void mark(int readLimit)
- Overrides:
mark
in class InputStream
reset
public void reset()
throws IOException
- Overrides:
reset
in class InputStream
- Throws:
IOException
Copyright © 2008 The Apache Software Foundation