|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.util.MetaUtils
public class MetaUtils
Contains utility methods for manipulating HBase meta tables.
Be sure to call shutdown() when done with this class so it closes
resources opened during meta processing (ROOT, META, etc.). Be careful
how you use this class. If used during migrations, be careful when using
this class to check whether migration is needed.
| 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(org.apache.hadoop.conf.Configuration conf)
|
|
| Method Summary | |
|---|---|
void |
addColumn(byte[] tableName,
HColumnDescriptor hcd)
Offline version of the online TableOperation, org.apache.hadoop.hbase.master.AddColumn. |
static void |
changeOnlineStatus(org.apache.hadoop.conf.Configuration c,
byte[] row,
boolean onlineOffline)
Set a single region on/offline. |
void |
deleteColumn(byte[] tableName,
byte[] columnFamily)
Offline version of the online TableOperation, org.apache.hadoop.hbase.master.DeleteColumn. |
HLog |
getLog()
|
HRegion |
getMetaRegion(HRegionInfo metaInfo)
Open or return cached opened meta region |
java.util.List<HRegionInfo> |
getMETARows(byte[] tableName)
|
HRegion |
getRootRegion()
|
void |
scanMetaRegion(HRegionInfo metaRegionInfo,
MetaUtils.ScannerListener listener)
Scans a meta region. |
void |
scanMetaRegion(HRegion r,
MetaUtils.ScannerListener listener)
Scan the passed in metaregion m invoking the passed
listener per row found. |
void |
scanRootRegion(MetaUtils.ScannerListener listener)
Scans the root region. |
void |
shutdown()
Closes catalog regions if open. |
void |
updateMETARegionInfo(HRegion r,
HRegionInfo hri)
Update COL_REGIONINFO in meta region r with HRegionInfo hri |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MetaUtils()
throws java.io.IOException
java.io.IOException - e
public MetaUtils(org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
conf - Configuration
java.io.IOException - e| Method Detail |
|---|
public HLog getLog()
throws java.io.IOException
java.io.IOException - e
public HRegion getRootRegion()
throws java.io.IOException
java.io.IOException - e
public HRegion getMetaRegion(HRegionInfo metaInfo)
throws java.io.IOException
metaInfo - HRegionInfo for meta region
java.io.IOException - epublic void shutdown()
public void scanRootRegion(MetaUtils.ScannerListener listener)
throws java.io.IOException
listener - method to be called for each meta region found
java.io.IOException - e
public void scanMetaRegion(HRegion r,
MetaUtils.ScannerListener listener)
throws java.io.IOException
m invoking the passed
listener per row found.
r - regionlistener - scanner listener
java.io.IOException - e
public void scanMetaRegion(HRegionInfo metaRegionInfo,
MetaUtils.ScannerListener listener)
throws java.io.IOException
Use for reading meta only. Does not close region when done.
Use getMetaRegion(HRegionInfo) instead if writing. Adds
meta region to list that will get a close on shutdown().
metaRegionInfo - HRegionInfo for meta regionlistener - method to be called for each meta region found
java.io.IOException - e
public static void changeOnlineStatus(org.apache.hadoop.conf.Configuration c,
byte[] row,
boolean onlineOffline)
throws java.io.IOException
HTable instance per invocation to go against .META.
c - A configuration that has its hbase.master
properly set.row - Row in the catalog .META. table whose HRegionInfo's offline
status we want to change.onlineOffline - Pass true to OFFLINE the region.
java.io.IOException - e
public void addColumn(byte[] tableName,
HColumnDescriptor hcd)
throws java.io.IOException
tableName - table namehcd - Add this column to tableName
java.io.IOException - e
public void deleteColumn(byte[] tableName,
byte[] columnFamily)
throws java.io.IOException
tableName - table namecolumnFamily - Name of column name to remove.
java.io.IOException - e
public void updateMETARegionInfo(HRegion r,
HRegionInfo hri)
throws java.io.IOException
r - regionhri - region info
java.io.IOException - e
public java.util.List<HRegionInfo> getMETARows(byte[] tableName)
throws java.io.IOException
tableName - Name of table to go looking for.
HRegionInfo rows found in the ROOT or META
catalog table.
java.io.IOException - egetMetaRegion(HRegionInfo)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||