|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.hfile.HFile.Reader
public static class HFile.Reader
HFile Reader.
Field Summary | |
---|---|
int |
blockLoads
|
int |
cacheHits
|
Constructor Summary | |
---|---|
HFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
BlockCache cache,
boolean inMemory)
Opens a HFile. |
|
HFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsdis,
long size,
BlockCache cache,
boolean inMemory)
Opens a HFile. |
Method Summary | |
---|---|
protected int |
blockContainingKey(byte[] key,
int offset,
int length)
|
void |
close()
|
org.apache.hadoop.io.RawComparator<byte[]> |
getComparator()
|
int |
getEntries()
|
byte[] |
getFirstKey()
|
byte[] |
getLastKey()
|
ByteBuffer |
getMetaBlock(String metaBlockName)
|
HFileScanner |
getScanner(boolean cacheBlocks,
boolean pread)
Create a Scanner on this file. |
String |
getTrailerInfo()
|
long |
indexSize()
|
boolean |
inMemory()
|
long |
length()
|
Map<byte[],byte[]> |
loadFileInfo()
Read in the index and file info. |
byte[] |
midkey()
|
String |
toString()
|
protected String |
toStringFirstKey()
|
protected String |
toStringLastKey()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int cacheHits
public int blockLoads
Constructor Detail |
---|
public HFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, BlockCache cache, boolean inMemory) throws IOException
loadFileInfo()
.
fs
- filesystem to load frompath
- path within said filesystemcache
- block cache. Pass null if none.
IOException
public HFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsdis, long size, BlockCache cache, boolean inMemory)
loadFileInfo()
.
fsdis
- input stream. Caller is responsible for closing the passed
stream.size
- Length of the stream.cache
- block cache. Pass null if none.
IOException
Method Detail |
---|
public String toString()
toString
in class Object
protected String toStringFirstKey()
protected String toStringLastKey()
public long length()
public boolean inMemory()
public Map<byte[],byte[]> loadFileInfo() throws IOException
HFile.Writer.appendFileInfo(byte[], byte[])
.
IOException
public HFileScanner getScanner(boolean cacheBlocks, boolean pread)
HFileScanner.seekTo(byte[])
to position an start the read.
There is nothing to clean up in a Scanner. Letting go of your references
to the scanner is sufficient.
pread
- Use positional read rather than seek+read if true (pread is
better for random reads, seek+read is better scanning).cacheBlocks
- True if we should cache blocks read in by this scanner.
protected int blockContainingKey(byte[] key, int offset, int length)
key
- Key to search.
public ByteBuffer getMetaBlock(String metaBlockName) throws IOException
metaBlockName
-
IOException
public byte[] getFirstKey()
public int getEntries()
public byte[] getLastKey()
public org.apache.hadoop.io.RawComparator<byte[]> getComparator()
public long indexSize()
public byte[] midkey() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
IOException
public String getTrailerInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |