|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.MapFile.Reader
org.apache.hadoop.hbase.io.HBaseMapFile.HBaseReader
org.apache.hadoop.hbase.io.BloomFilterMapFile.Reader
org.apache.hadoop.hbase.io.HalfMapFileReader
public class HalfMapFileReader
A facade for a MapFile.Reader
that serves up
either the top or bottom half of a MapFile where 'bottom' is the first half
of the file containing the keys that sort lowest and 'top' is the second half
of the file with keys that sort greater than those of the bottom half.
The top includes the split files midkey, of the key that follows if it does
not exist in the file.
This type works in tandem with the Reference
type. This class
is used reading while Reference is used writing.
This file is not splitable. Calls to midKey()
return null.
Constructor Summary | |
---|---|
HalfMapFileReader(org.apache.hadoop.fs.FileSystem fs,
String dirName,
org.apache.hadoop.conf.Configuration conf,
Reference.Range r,
org.apache.hadoop.io.WritableComparable<HStoreKey> mk,
boolean filter,
boolean blockCacheEnabled,
HRegionInfo hri)
|
|
HalfMapFileReader(org.apache.hadoop.fs.FileSystem fs,
String dirName,
org.apache.hadoop.conf.Configuration conf,
Reference.Range r,
org.apache.hadoop.io.WritableComparable<HStoreKey> mk,
HRegionInfo hri)
|
Method Summary | |
---|---|
void |
finalKey(org.apache.hadoop.io.WritableComparable key)
Reads the final key from the file. |
org.apache.hadoop.io.Writable |
get(org.apache.hadoop.io.WritableComparable key,
org.apache.hadoop.io.Writable val)
Return the value for the named key, or null if none exists. |
org.apache.hadoop.io.WritableComparable |
getClosest(org.apache.hadoop.io.WritableComparable key,
org.apache.hadoop.io.Writable val)
Finds the record that is the closest match to the specified key. |
org.apache.hadoop.io.WritableComparable |
midKey()
Get the key at approximately the middle of the file. |
boolean |
next(org.apache.hadoop.io.WritableComparable key,
org.apache.hadoop.io.Writable val)
Read the next key/value pair in the map into key and
val . |
void |
reset()
Re-positions the reader before its first key. |
boolean |
seek(org.apache.hadoop.io.WritableComparable key)
Positions the reader at the named key, or if none such exists, at the first entry after the named key. |
Methods inherited from class org.apache.hadoop.hbase.io.BloomFilterMapFile.Reader |
---|
getBloomFilterSize |
Methods inherited from class org.apache.hadoop.hbase.io.HBaseMapFile.HBaseReader |
---|
createDataFileReader |
Methods inherited from class org.apache.hadoop.hbase.io.MapFile.Reader |
---|
close, getClosest, getKeyClass, getValueClass, open |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HalfMapFileReader(org.apache.hadoop.fs.FileSystem fs, String dirName, org.apache.hadoop.conf.Configuration conf, Reference.Range r, org.apache.hadoop.io.WritableComparable<HStoreKey> mk, HRegionInfo hri) throws IOException
fs
- dirName
- conf
- r
- mk
- hri
-
IOException
public HalfMapFileReader(org.apache.hadoop.fs.FileSystem fs, String dirName, org.apache.hadoop.conf.Configuration conf, Reference.Range r, org.apache.hadoop.io.WritableComparable<HStoreKey> mk, boolean filter, boolean blockCacheEnabled, HRegionInfo hri) throws IOException
fs
- dirName
- conf
- r
- mk
- filter
- blockCacheEnabled
- hri
-
IOException
Method Detail |
---|
public void finalKey(org.apache.hadoop.io.WritableComparable key) throws IOException
MapFile.Reader
finalKey
in class MapFile.Reader
key
- key to read into
IOException
public org.apache.hadoop.io.Writable get(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val) throws IOException
MapFile.Reader
get
in class BloomFilterMapFile.Reader
IOException
public org.apache.hadoop.io.WritableComparable getClosest(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val) throws IOException
MapFile.Reader
key
or if it does not exist, at the first entry
after the named key.
- * @param key - key that we're trying to find
- * @param val - data value if key is found
- * @return - the key that was the closest match or null if eof.
getClosest
in class BloomFilterMapFile.Reader
IOException
public org.apache.hadoop.io.WritableComparable midKey() throws IOException
MapFile.Reader
midKey
in class MapFile.Reader
IOException
public boolean next(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val) throws IOException
MapFile.Reader
key
and
val
. Returns true if such a pair exists and false when at
the end of the map
next
in class MapFile.Reader
IOException
public void reset() throws IOException
MapFile.Reader
reset
in class MapFile.Reader
IOException
public boolean seek(org.apache.hadoop.io.WritableComparable key) throws IOException
MapFile.Reader
seek
in class MapFile.Reader
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |