org.apache.hadoop.hbase.util
Class MetaUtils

java.lang.Object
  extended by org.apache.hadoop.hbase.util.MetaUtils

public class MetaUtils
extends Object

Contains utility methods for manipulating HBase meta tables


Nested Class Summary
static interface MetaUtils.ScannerListener
          Used by scanRootRegion and scanMetaRegion to call back the caller so it can process the data for a row.
 
Constructor Summary
MetaUtils()
          Default constructor
MetaUtils(HBaseConfiguration conf)
           
 
Method Summary
 HLog getLog()
           
 HRegion getMetaRegion(HRegionInfo metaInfo)
          Open or return cached opened meta region
 HRegion getRootRegion()
           
 org.apache.hadoop.fs.Path initialize()
          Verifies that DFS is available and that HBase is off-line.
 boolean isInitialized()
           
 void scanMetaRegion(HRegionInfo metaRegionInfo, MetaUtils.ScannerListener listener)
          Scans a meta region.
 void scanRootRegion(MetaUtils.ScannerListener listener)
          Scans the root region.
 void shutdown()
          Closes root region if open.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaUtils

public MetaUtils()
Default constructor


MetaUtils

public MetaUtils(HBaseConfiguration conf)
Parameters:
conf - HBaseConfiguration
Method Detail

initialize

public org.apache.hadoop.fs.Path initialize()
                                     throws IOException
Verifies that DFS is available and that HBase is off-line.

Returns:
Path of root directory of HBase installation
Throws:
IOException

isInitialized

public boolean isInitialized()
Returns:
true if initialization completed successfully

getLog

public HLog getLog()
Returns:
the HLog

getRootRegion

public HRegion getRootRegion()
                      throws IOException
Returns:
HRegion for root region
Throws:
IOException

getMetaRegion

public HRegion getMetaRegion(HRegionInfo metaInfo)
                      throws IOException
Open or return cached opened meta region

Parameters:
metaInfo - HRegionInfo for meta region
Returns:
meta HRegion
Throws:
IOException

shutdown

public void shutdown()
Closes root region if open. Also closes and deletes the HLog.


scanRootRegion

public void scanRootRegion(MetaUtils.ScannerListener listener)
                    throws IOException
Scans the root region. For every meta region found, calls the listener with the HRegionInfo of the meta region.

Parameters:
listener - method to be called for each meta region found
Throws:
IOException

scanMetaRegion

public void scanMetaRegion(HRegionInfo metaRegionInfo,
                           MetaUtils.ScannerListener listener)
                    throws IOException
Scans a meta region. For every region found, calls the listener with the HRegionInfo of the region.

Parameters:
metaRegionInfo - HRegionInfo for meta region
listener - method to be called for each meta region found
Throws:
IOException


Copyright © 2008 The Apache Software Foundation