|
||||||||||
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(HBaseConfiguration conf)
|
Method Summary | |
---|---|
void |
addColumn(byte[] tableName,
HColumnDescriptor hcd)
Offline version of the online TableOperation, org.apache.hadoop.hbase.master.AddColumn. |
static void |
changeOnlineStatus(HBaseConfiguration 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 |
List<HRegionInfo> |
getMETARows(byte[] tableName)
|
HRegion |
getRootRegion()
|
void |
scanMetaRegion(HRegionInfo metaRegionInfo,
MetaUtils.ScannerListener listener)
Scans a meta region. |
void |
scanMetaRegion(HRegion m,
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 IOException
IOException
public MetaUtils(HBaseConfiguration conf) throws IOException
conf
- HBaseConfiguration
IOException
Method Detail |
---|
public HLog getLog() throws IOException
IOException
public HRegion getRootRegion() throws IOException
IOException
public HRegion getMetaRegion(HRegionInfo metaInfo) throws IOException
metaInfo
- HRegionInfo for meta region
IOException
public void shutdown()
public void scanRootRegion(MetaUtils.ScannerListener listener) throws IOException
listener
- method to be called for each meta region found
IOException
public void scanMetaRegion(HRegionInfo metaRegionInfo, MetaUtils.ScannerListener listener) throws IOException
metaRegionInfo
- HRegionInfo for meta regionlistener
- method to be called for each meta region found
IOException
public void scanMetaRegion(HRegion m, MetaUtils.ScannerListener listener) throws IOException
m
invoking the passed
listener
per row found.
m
- listener
-
IOException
public static void changeOnlineStatus(HBaseConfiguration c, byte[] row, boolean onlineOffline) throws 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.
IOException
public void addColumn(byte[] tableName, HColumnDescriptor hcd) throws IOException
tableName
- hcd
- Add this column to tableName
IOException
public void deleteColumn(byte[] tableName, byte[] columnFamily) throws IOException
tableName
- columnFamily
- Name of column name to remove.
IOException
public void updateMETARegionInfo(HRegion r, HRegionInfo hri) throws IOException
r
- hri
-
IOException
public List<HRegionInfo> getMETARows(byte[] tableName) throws IOException
tableName
- Name of table to go looking for.
HRegionInfo
rows found in the ROOT or META
catalog table.
IOException
getMetaRegion(HRegionInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |