org.apache.hadoop.hbase.migration.nineteen.io
Class HalfMapFileReader

java.lang.Object
  extended by org.apache.hadoop.io.MapFile.Reader
      extended by org.apache.hadoop.hbase.migration.nineteen.io.HBaseMapFile.HBaseReader
          extended by org.apache.hadoop.hbase.migration.nineteen.io.BloomFilterMapFile.Reader
              extended by org.apache.hadoop.hbase.migration.nineteen.io.HalfMapFileReader
All Implemented Interfaces:
Closeable

public class HalfMapFileReader
extends BloomFilterMapFile.Reader

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)
           
 org.apache.hadoop.io.Writable get(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val)
           
 org.apache.hadoop.io.WritableComparable getClosest(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val)
           
 org.apache.hadoop.io.WritableComparable midKey()
           
 boolean next(org.apache.hadoop.io.WritableComparable key, org.apache.hadoop.io.Writable val)
           
 void reset()
           
 boolean seek(org.apache.hadoop.io.WritableComparable key)
           
 
Methods inherited from class org.apache.hadoop.hbase.migration.nineteen.io.BloomFilterMapFile.Reader
getBloomFilterSize
 
Methods inherited from class org.apache.hadoop.io.MapFile.Reader
close, createDataFileReader, getClosest, getKeyClass, getValueClass, open
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HalfMapFileReader

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
Parameters:
fs -
dirName -
conf -
r -
mk -
hri -
Throws:
IOException

HalfMapFileReader

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
Parameters:
fs -
dirName -
conf -
r -
mk -
filter -
blockCacheEnabled -
hri -
Throws:
IOException
Method Detail

finalKey

public void finalKey(org.apache.hadoop.io.WritableComparable key)
              throws IOException
Overrides:
finalKey in class org.apache.hadoop.io.MapFile.Reader
Throws:
IOException

get

public org.apache.hadoop.io.Writable get(org.apache.hadoop.io.WritableComparable key,
                                         org.apache.hadoop.io.Writable val)
                                  throws IOException
Overrides:
get in class BloomFilterMapFile.Reader
Throws:
IOException

getClosest

public org.apache.hadoop.io.WritableComparable getClosest(org.apache.hadoop.io.WritableComparable key,
                                                          org.apache.hadoop.io.Writable val)
                                                   throws IOException
Overrides:
getClosest in class BloomFilterMapFile.Reader
Throws:
IOException

midKey

public org.apache.hadoop.io.WritableComparable midKey()
                                               throws IOException
Overrides:
midKey in class org.apache.hadoop.io.MapFile.Reader
Throws:
IOException

next

public boolean next(org.apache.hadoop.io.WritableComparable key,
                    org.apache.hadoop.io.Writable val)
             throws IOException
Overrides:
next in class org.apache.hadoop.io.MapFile.Reader
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class org.apache.hadoop.io.MapFile.Reader
Throws:
IOException

seek

public boolean seek(org.apache.hadoop.io.WritableComparable key)
             throws IOException
Overrides:
seek in class org.apache.hadoop.io.MapFile.Reader
Throws:
IOException


Copyright © 2009 The Apache Software Foundation