|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.HBaseAdmin
public class HBaseAdmin
Provides administrative functions for HBase
| Field Summary | |
|---|---|
protected HConnection |
connection
|
protected org.apache.commons.logging.Log |
LOG
|
protected HMasterInterface |
master
|
protected int |
numRetries
|
protected long |
pause
|
| Constructor Summary | |
|---|---|
HBaseAdmin(Configuration conf)
Constructor |
|
| Method Summary | |
|---|---|
void |
addColumn(Text tableName,
HColumnDescriptor column)
Add a column to an existing table |
protected void |
checkReservedTableName(Text tableName)
|
void |
createTable(HTableDescriptor desc)
Creates a new table |
void |
createTableAsync(HTableDescriptor desc)
Creates a new table but does not block and wait for it to come online. |
void |
deleteColumn(Text tableName,
Text columnName)
Delete a column from a table |
void |
deleteTable(Text tableName)
Deletes a table |
void |
disableTable(Text tableName)
Disables a table (takes it off-line) If it is being served, the master will tell the servers to stop serving it. |
void |
enableTable(Text tableName)
Brings a table on-line (enables it) |
HMasterInterface |
getMaster()
|
boolean |
isMasterRunning()
|
HTableDescriptor[] |
listTables()
List all the userspace tables. |
void |
shutdown()
Shuts down the HBase instance |
boolean |
tableExists(Text tableName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log LOG
protected final HConnection connection
protected final long pause
protected final int numRetries
protected volatile HMasterInterface master
| Constructor Detail |
|---|
public HBaseAdmin(Configuration conf)
throws MasterNotRunningException
conf - Configuration object
MasterNotRunningException| Method Detail |
|---|
public HMasterInterface getMaster()
throws MasterNotRunningException
MasterNotRunningExceptionpublic boolean isMasterRunning()
public boolean tableExists(Text tableName)
throws MasterNotRunningException
tableName - Table to check.
MasterNotRunningException
public HTableDescriptor[] listTables()
throws IOException
IOException
public void createTable(HTableDescriptor desc)
throws IOException
desc - table descriptor for table
IllegalArgumentException - if the table name is reserved
MasterNotRunningException - if master is not running
NoServerForRegionException - if root region is not being served
TableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence
and attempt-at-creation).
IOException
public void createTableAsync(HTableDescriptor desc)
throws IOException
desc - table descriptor for table
IllegalArgumentException - if the table name is reserved
MasterNotRunningException - if master is not running
NoServerForRegionException - if root region is not being served
TableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence
and attempt-at-creation).
IOException
public void deleteTable(Text tableName)
throws IOException
tableName - name of table to delete
IOException
public void enableTable(Text tableName)
throws IOException
tableName - name of the table
IOException
public void disableTable(Text tableName)
throws IOException
tableName - name of table
IOException
public void addColumn(Text tableName,
HColumnDescriptor column)
throws IOException
tableName - name of the table to add column tocolumn - column descriptor of column to be added
IOException
public void deleteColumn(Text tableName,
Text columnName)
throws IOException
tableName - name of tablecolumnName - name of column to be deleted
IOException
public void shutdown()
throws IOException
IOExceptionprotected void checkReservedTableName(Text tableName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||