org.apache.hadoop.hbase.catalog
Class MetaEditor

java.lang.Object
  extended by org.apache.hadoop.hbase.catalog.MetaEditor

public class MetaEditor
extends Object

Writes region and assignment information to .META..

Uses the CatalogTracker to obtain locations and connections to catalogs.


Constructor Summary
MetaEditor()
           
 
Method Summary
static void addDaughter(CatalogTracker catalogTracker, HRegionInfo regionInfo, HServerInfo serverInfo)
           
static void addRegionToMeta(CatalogTracker catalogTracker, HRegionInfo regionInfo)
          Adds a META row for the specified new region.
static void deleteDaughterReferenceInParent(CatalogTracker catalogTracker, HRegionInfo parent, byte[] qualifier, HRegionInfo daughter)
          Deletes daughter reference in offlined split parent.
static void deleteRegion(CatalogTracker catalogTracker, HRegionInfo regionInfo)
          Deletes the specified region from META.
static void offlineParentInMeta(CatalogTracker catalogTracker, HRegionInfo parent, HRegionInfo a, HRegionInfo b)
          Offline parent in meta.
static void updateMetaLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, HServerInfo serverInfo)
          Updates the location of the specified META region in ROOT to be the specified server hostname and startcode.
static void updateRegionInfo(CatalogTracker catalogTracker, HRegionInfo regionInfo)
          Updates the region information for the specified region in META.
static void updateRegionLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, HServerInfo serverInfo)
          Updates the location of the specified region in META to be the specified server hostname and startcode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaEditor

public MetaEditor()
Method Detail

addRegionToMeta

public static void addRegionToMeta(CatalogTracker catalogTracker,
                                   HRegionInfo regionInfo)
                            throws IOException
Adds a META row for the specified new region.

Parameters:
regionInfo - region information
Throws:
IOException - if problem connecting or updating meta

offlineParentInMeta

public static void offlineParentInMeta(CatalogTracker catalogTracker,
                                       HRegionInfo parent,
                                       HRegionInfo a,
                                       HRegionInfo b)
                                throws NotAllMetaRegionsOnlineException,
                                       IOException
Offline parent in meta. Used when splitting.

Parameters:
catalogTracker -
parent -
a - Split daughter region A
b - Split daughter region B
Throws:
NotAllMetaRegionsOnlineException
IOException

addDaughter

public static void addDaughter(CatalogTracker catalogTracker,
                               HRegionInfo regionInfo,
                               HServerInfo serverInfo)
                        throws NotAllMetaRegionsOnlineException,
                               IOException
Throws:
NotAllMetaRegionsOnlineException
IOException

updateMetaLocation

public static void updateMetaLocation(CatalogTracker catalogTracker,
                                      HRegionInfo regionInfo,
                                      HServerInfo serverInfo)
                               throws IOException,
                                      ConnectException
Updates the location of the specified META region in ROOT to be the specified server hostname and startcode.

Uses passed catalog tracker to get a connection to the server hosting ROOT and makes edits to that region.

Parameters:
catalogTracker - catalog tracker
regionInfo - region to update location of
serverInfo - server the region is located on
Throws:
IOException
ConnectException - Usually because the regionserver carrying .META. is down.
NullPointerException - Because no -ROOT- server connection

updateRegionLocation

public static void updateRegionLocation(CatalogTracker catalogTracker,
                                        HRegionInfo regionInfo,
                                        HServerInfo serverInfo)
                                 throws IOException
Updates the location of the specified region in META to be the specified server hostname and startcode.

Uses passed catalog tracker to get a connection to the server hosting META and makes edits to that region.

Parameters:
catalogTracker - catalog tracker
regionInfo - region to update location of
serverInfo - server the region is located on
Throws:
IOException

deleteRegion

public static void deleteRegion(CatalogTracker catalogTracker,
                                HRegionInfo regionInfo)
                         throws IOException
Deletes the specified region from META.

Parameters:
catalogTracker -
regionInfo - region to be deleted from META
Throws:
IOException

deleteDaughterReferenceInParent

public static void deleteDaughterReferenceInParent(CatalogTracker catalogTracker,
                                                   HRegionInfo parent,
                                                   byte[] qualifier,
                                                   HRegionInfo daughter)
                                            throws NotAllMetaRegionsOnlineException,
                                                   IOException
Deletes daughter reference in offlined split parent.

Parameters:
catalogTracker -
parent - Parent row we're to remove daughter reference from
qualifier - SplitA or SplitB daughter to remove
daughter -
Throws:
NotAllMetaRegionsOnlineException
IOException

updateRegionInfo

public static void updateRegionInfo(CatalogTracker catalogTracker,
                                    HRegionInfo regionInfo)
                             throws IOException
Updates the region information for the specified region in META.

Parameters:
catalogTracker -
regionInfo - region to be updated in META
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.