@InterfaceAudience.Public @InterfaceStability.Evolving public interface Admin extends Abortable, java.io.Closeable
Connection.getAdmin() and
call close() afterwards.
Admin can be used to create, drop, list, enable and disable tables, add and drop table column families and other administrative operations.
ConnectionFactory,
Connection,
Table| Modifier and Type | Interface and Description |
|---|---|
static class |
Admin.CompactType
Currently, there are only two compact types:
NORMAL means do store files compaction;
MOB means do mob files compaction. |
static class |
Admin.MasterSwitchType |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.lang.String why,
java.lang.Throwable e)
Abort the server or client.
|
boolean |
abortProcedure(long procId,
boolean mayInterruptIfRunning)
abort a procedure
|
java.util.concurrent.Future<java.lang.Boolean> |
abortProcedureAsync(long procId,
boolean mayInterruptIfRunning)
Abort a procedure but does not block and wait for it be completely removed.
|
void |
addColumn(TableName tableName,
HColumnDescriptor column)
Add a column to an existing table.
|
void |
assign(byte[] regionName) |
boolean |
balancer()
Invoke the balancer.
|
boolean |
balancer(boolean force)
Invoke the balancer.
|
void |
cloneSnapshot(byte[] snapshotName,
TableName tableName)
Create a new table by cloning the snapshot content.
|
void |
cloneSnapshot(java.lang.String snapshotName,
TableName tableName)
Create a new table by cloning the snapshot content.
|
void |
cloneSnapshot(java.lang.String snapshotName,
TableName tableName,
boolean restoreAcl)
Create a new table by cloning the snapshot content.
|
void |
close() |
void |
closeRegion(byte[] regionname,
java.lang.String serverName)
Close a region.
|
void |
closeRegion(ServerName sn,
HRegionInfo hri)
Close a region.
|
void |
closeRegion(java.lang.String regionname,
java.lang.String serverName)
Close a region.
|
boolean |
closeRegionWithEncodedRegionName(java.lang.String encodedRegionName,
java.lang.String serverName)
For expert-admins.
|
void |
compact(TableName tableName)
Compact a table.
|
void |
compact(TableName tableName,
Admin.CompactType compactType)
Compact a table.
|
void |
compact(TableName tableName,
byte[] columnFamily)
Compact a column family within a table.
|
void |
compact(TableName tableName,
byte[] columnFamily,
Admin.CompactType compactType)
Compact a column family within a table.
|
void |
compactRegion(byte[] regionName)
Compact an individual region.
|
void |
compactRegion(byte[] regionName,
byte[] columnFamily)
Compact a column family within a region.
|
void |
compactRegionServer(ServerName sn,
boolean major)
Compact all regions on the region server
|
CoprocessorRpcChannel |
coprocessorService()
Creates and returns a
com.google.protobuf.RpcChannel instance connected to the active
master. |
CoprocessorRpcChannel |
coprocessorService(ServerName sn)
Creates and returns a
com.google.protobuf.RpcChannel instance
connected to the passed region server. |
void |
createNamespace(NamespaceDescriptor descriptor)
Create a new namespace
|
void |
createTable(HTableDescriptor desc)
Creates a new table.
|
void |
createTable(HTableDescriptor desc,
byte[][] splitKeys)
Creates a new table with an initial set of empty regions defined by the specified split keys.
|
void |
createTable(HTableDescriptor desc,
byte[] startKey,
byte[] endKey,
int numRegions)
Creates a new table with the specified number of regions.
|
void |
createTableAsync(HTableDescriptor desc,
byte[][] splitKeys)
Creates a new table but does not block and wait for it to come online.
|
void |
deleteColumn(TableName tableName,
byte[] columnName)
Delete a column from a table.
|
void |
deleteNamespace(java.lang.String name)
Delete an existing namespace.
|
void |
deleteSnapshot(byte[] snapshotName)
Delete an existing snapshot.
|
void |
deleteSnapshot(java.lang.String snapshotName)
Delete an existing snapshot.
|
void |
deleteSnapshots(java.util.regex.Pattern pattern)
Delete existing snapshots whose names match the pattern passed.
|
void |
deleteSnapshots(java.lang.String regex)
Delete existing snapshots whose names match the pattern passed.
|
void |
deleteTable(TableName tableName)
Deletes a table.
|
HTableDescriptor[] |
deleteTables(java.util.regex.Pattern pattern)
Delete tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
deleteTables(java.lang.String regex)
Deletes tables matching the passed in pattern and wait on completion.
|
void |
disableTable(TableName tableName)
Disable table and wait on completion.
|
void |
disableTableAsync(TableName tableName)
Starts the disable of a table.
|
HTableDescriptor[] |
disableTables(java.util.regex.Pattern pattern)
Disable tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
disableTables(java.lang.String regex)
Disable tables matching the passed in pattern and wait on completion.
|
boolean |
enableCatalogJanitor(boolean enable)
Enable/Disable the catalog janitor
|
void |
enableTable(TableName tableName)
Enable a table.
|
void |
enableTableAsync(TableName tableName)
Brings a table on-line (enables it).
|
HTableDescriptor[] |
enableTables(java.util.regex.Pattern pattern)
Enable tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
enableTables(java.lang.String regex)
Enable tables matching the passed in pattern and wait on completion.
|
void |
execProcedure(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
Execute a distributed procedure on a cluster.
|
byte[] |
execProcedureWithRet(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
Execute a distributed procedure on a cluster.
|
void |
flush(TableName tableName)
Flush a table.
|
void |
flushRegion(byte[] regionName)
Flush an individual region.
|
Pair<java.lang.Integer,java.lang.Integer> |
getAlterStatus(byte[] tableName)
Get the status of alter command - indicates how many regions have received the updated schema
Asynchronous operation.
|
Pair<java.lang.Integer,java.lang.Integer> |
getAlterStatus(TableName tableName)
Get the status of alter command - indicates how many regions have received the updated schema
Asynchronous operation.
|
BackupAdmin |
getBackupAdmin()
Get Backup Admin interface
|
ClusterStatus |
getClusterStatus() |
AdminProtos.GetRegionInfoResponse.CompactionState |
getCompactionState(TableName tableName)
Get the current compaction state of a table.
|
AdminProtos.GetRegionInfoResponse.CompactionState |
getCompactionState(TableName tableName,
Admin.CompactType compactType)
Get the current compaction state of a table.
|
AdminProtos.GetRegionInfoResponse.CompactionState |
getCompactionStateForRegion(byte[] regionName)
Get the current compaction state of region.
|
Configuration |
getConfiguration() |
Connection |
getConnection() |
long |
getLastMajorCompactionTimestamp(TableName tableName)
Get the timestamp of the last major compaction for the passed table
The timestamp of the oldest HFile resulting from a major compaction of that table,
or 0 if no such HFile could be found.
|
long |
getLastMajorCompactionTimestampForRegion(byte[] regionName)
Get the timestamp of the last major compaction for the passed region.
|
java.lang.String[] |
getMasterCoprocessors()
Helper delegage to getClusterStatus().getMasterCoprocessors().
|
int |
getMasterInfoPort()
Get the info port of the current master if one is available.
|
NamespaceDescriptor |
getNamespaceDescriptor(java.lang.String name)
Get a namespace descriptor by name
|
java.util.List<HRegionInfo> |
getOnlineRegions(ServerName sn)
Get all the online regions on a region server.
|
int |
getOperationTimeout() |
QuotaRetriever |
getQuotaRetriever(QuotaFilter filter)
Return a QuotaRetriever to list the quotas based on the filter.
|
HTableDescriptor |
getTableDescriptor(TableName tableName)
Method for getting the tableDescriptor
|
HTableDescriptor[] |
getTableDescriptors(java.util.List<java.lang.String> names)
Get tableDescriptors
|
HTableDescriptor[] |
getTableDescriptorsByTableName(java.util.List<TableName> tableNames)
Get tableDescriptors
|
java.util.List<HRegionInfo> |
getTableRegions(TableName tableName)
Get the regions of a given table.
|
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
isBalancerEnabled()
Query the current state of the balancer
|
boolean |
isCatalogJanitorEnabled()
Query on the catalog janitor state (Enabled/Disabled?)
|
boolean |
isMasterInMaintenanceMode()
Check whether Master is in maintenance mode
|
boolean |
isNormalizerEnabled()
Query the current state of the region normalizer
|
boolean |
isProcedureFinished(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
Check the current state of the specified procedure.
|
boolean |
isSnapshotFinished(HBaseProtos.SnapshotDescription snapshot)
Check the current state of the passed snapshot.
|
boolean |
isSplitOrMergeEnabled(Admin.MasterSwitchType switchType)
Query the current state of the switch
|
boolean |
isTableAvailable(TableName tableName) |
boolean |
isTableAvailable(TableName tableName,
byte[][] splitKeys)
Use this api to check if the table has been created with the specified number of splitkeys
which was used while creating the given table.
|
boolean |
isTableDisabled(TableName tableName) |
boolean |
isTableEnabled(TableName tableName) |
NamespaceDescriptor[] |
listNamespaceDescriptors()
List available namespace descriptors
|
ProcedureInfo[] |
listProcedures()
List procedures
|
java.util.List<HBaseProtos.SnapshotDescription> |
listSnapshots()
List completed snapshots.
|
java.util.List<HBaseProtos.SnapshotDescription> |
listSnapshots(java.util.regex.Pattern pattern)
List all the completed snapshots matching the given pattern.
|
java.util.List<HBaseProtos.SnapshotDescription> |
listSnapshots(java.lang.String regex)
List all the completed snapshots matching the given regular expression.
|
HTableDescriptor[] |
listTableDescriptorsByNamespace(java.lang.String name)
Get list of table descriptors by namespace
|
TableName[] |
listTableNames()
List all of the names of userspace tables.
|
TableName[] |
listTableNames(java.util.regex.Pattern pattern)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(java.util.regex.Pattern pattern,
boolean includeSysTables)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(java.lang.String regex)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(java.lang.String regex,
boolean includeSysTables)
List all of the names of userspace tables.
|
TableName[] |
listTableNamesByNamespace(java.lang.String name)
Get list of table names by namespace
|
HTableDescriptor[] |
listTables()
List all the userspace tables.
|
HTableDescriptor[] |
listTables(java.util.regex.Pattern pattern)
List all the userspace tables matching the given pattern.
|
HTableDescriptor[] |
listTables(java.util.regex.Pattern pattern,
boolean includeSysTables)
List all the tables matching the given pattern.
|
HTableDescriptor[] |
listTables(java.lang.String regex)
List all the userspace tables matching the given regular expression.
|
HTableDescriptor[] |
listTables(java.lang.String regex,
boolean includeSysTables)
List all the tables matching the given pattern.
|
void |
majorCompact(TableName tableName)
Major compact a table.
|
void |
majorCompact(TableName tableName,
Admin.CompactType compactType)
Major compact a table.
|
void |
majorCompact(TableName tableName,
byte[] columnFamily)
Major compact a column family within a table.
|
void |
majorCompact(TableName tableName,
byte[] columnFamily,
Admin.CompactType compactType)
Major compact a column family within a table.
|
void |
majorCompactRegion(byte[] regionName)
Major compact a table or an individual region.
|
void |
majorCompactRegion(byte[] regionName,
byte[] columnFamily)
Major compact a column family within region.
|
void |
mergeRegions(byte[] encodedNameOfRegionA,
byte[] encodedNameOfRegionB,
boolean forcible)
Merge two regions.
|
void |
modifyColumn(TableName tableName,
HColumnDescriptor descriptor)
Modify an existing column family on a table.
|
void |
modifyNamespace(NamespaceDescriptor descriptor)
Modify an existing namespace
|
void |
modifyTable(TableName tableName,
HTableDescriptor htd)
Modify an existing table, more IRB friendly version.
|
void |
move(byte[] encodedRegionName,
byte[] destServerName)
Move the region
r to dest. |
boolean |
normalize()
Invoke region normalizer.
|
void |
offline(byte[] regionName)
Offline specified region from master's in-memory state.
|
void |
restoreSnapshot(byte[] snapshotName)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(byte[] snapshotName,
boolean takeFailSafeSnapshot)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(java.lang.String snapshotName)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(java.lang.String snapshotName,
boolean takeFailSafeSnapshot)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(java.lang.String snapshotName,
boolean takeFailSafeSnapshot,
boolean restoreAcl)
Restore the specified snapshot on the original table.
|
void |
rollWALWriter(ServerName serverName)
Roll the log writer.
|
int |
runCatalogScan()
Ask for a scan of the catalog table
|
boolean |
setBalancerRunning(boolean on,
boolean synchronous)
Turn the load balancer on or off.
|
boolean |
setNormalizerRunning(boolean on)
Turn region normalizer on or off.
|
void |
setQuota(QuotaSettings quota)
Apply the new quota settings.
|
boolean[] |
setSplitOrMergeEnabled(boolean enabled,
boolean synchronous,
Admin.MasterSwitchType... switchTypes)
Turn the Split or Merge switches on or off.
|
void |
shutdown()
Shuts down the HBase cluster
|
void |
snapshot(byte[] snapshotName,
TableName tableName)
public void snapshot(final String snapshotName, Create a timestamp consistent snapshot for the
given table.
|
void |
snapshot(HBaseProtos.SnapshotDescription snapshot)
Take a snapshot and wait for the server to complete that snapshot (blocking).
|
void |
snapshot(java.lang.String snapshotName,
TableName tableName)
Take a snapshot for the given table.
|
void |
snapshot(java.lang.String snapshotName,
TableName tableName,
HBaseProtos.SnapshotDescription.Type type)
Create typed snapshot of the table.
|
void |
split(TableName tableName)
Split a table.
|
void |
split(TableName tableName,
byte[] splitPoint)
Split a table.
|
void |
splitRegion(byte[] regionName)
Split an individual region.
|
void |
splitRegion(byte[] regionName,
byte[] splitPoint)
Split an individual region.
|
void |
stopMaster()
Shuts down the current HBase master only.
|
void |
stopRegionServer(java.lang.String hostnamePort)
Stop the designated regionserver
|
boolean |
tableExists(TableName tableName) |
MasterProtos.SnapshotResponse |
takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)
Take a snapshot without waiting for the server to complete that snapshot (asynchronous) Only a
single snapshot should be taken at a time, or results may be undefined.
|
void |
truncateTable(TableName tableName,
boolean preserveSplits)
Truncate a table.
|
void |
unassign(byte[] regionName,
boolean force)
Unassign a region from current hosting regionserver.
|
void |
updateConfiguration()
Update the configuration and trigger an online config change
on all the regionservers
|
void |
updateConfiguration(ServerName server)
Update the configuration and trigger an online config change
on the regionserver
|
int getOperationTimeout()
void abort(java.lang.String why,
java.lang.Throwable e)
Abortableboolean isAborted()
AbortableConnection getConnection()
boolean tableExists(TableName tableName) throws java.io.IOException
tableName - Table to check.java.io.IOExceptionHTableDescriptor[] listTables() throws java.io.IOException
java.io.IOException - if a remote or network exception occursHTableDescriptor[] listTables(java.util.regex.Pattern pattern) throws java.io.IOException
pattern - The compiled regular expression to match againstjava.io.IOException - if a remote or network exception occurslistTables()HTableDescriptor[] listTables(java.lang.String regex) throws java.io.IOException
regex - The regular expression to match againstjava.io.IOException - if a remote or network exception occurslistTables(java.util.regex.Pattern)HTableDescriptor[] listTables(java.util.regex.Pattern pattern, boolean includeSysTables) throws java.io.IOException
pattern - The compiled regular expression to match againstincludeSysTables - False to match only against userspace tablesjava.io.IOException - if a remote or network exception occurslistTables()HTableDescriptor[] listTables(java.lang.String regex, boolean includeSysTables) throws java.io.IOException
regex - The regular expression to match againstincludeSysTables - False to match only against userspace tablesjava.io.IOException - if a remote or network exception occurslistTables(java.util.regex.Pattern, boolean)TableName[] listTableNames() throws java.io.IOException
java.io.IOException - if a remote or network exception occursTableName[] listTableNames(java.util.regex.Pattern pattern) throws java.io.IOException
pattern - The regular expression to match againstjava.io.IOException - if a remote or network exception occursTableName[] listTableNames(java.lang.String regex) throws java.io.IOException
regex - The regular expression to match againstjava.io.IOException - if a remote or network exception occursTableName[] listTableNames(java.util.regex.Pattern pattern, boolean includeSysTables) throws java.io.IOException
pattern - The regular expression to match againstincludeSysTables - False to match only against userspace tablesjava.io.IOException - if a remote or network exception occursTableName[] listTableNames(java.lang.String regex, boolean includeSysTables) throws java.io.IOException
regex - The regular expression to match againstincludeSysTables - False to match only against userspace tablesjava.io.IOException - if a remote or network exception occursHTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, java.io.IOException
tableName - as a TableNameTableNotFoundExceptionjava.io.IOException - if a remote or network exception occursvoid createTable(HTableDescriptor desc) throws java.io.IOException
desc - table descriptor for tablejava.lang.IllegalArgumentException - if the table name is reservedMasterNotRunningException - if master is not runningTableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence and attempt-at-creation).java.io.IOException - if a remote or network exception occursvoid createTable(HTableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) throws java.io.IOException
desc - table descriptor for tablestartKey - beginning of key rangeendKey - end of key rangenumRegions - the total number of regions to createjava.lang.IllegalArgumentException - if the table name is reservedMasterNotRunningException - if master is not runningTableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence and attempt-at-creation).java.io.IOExceptionvoid createTable(HTableDescriptor desc, byte[][] splitKeys) throws java.io.IOException
desc - table descriptor for tablesplitKeys - array of split keys for the initial regions of the tablejava.lang.IllegalArgumentException - if the table name is reserved, if the split keys are repeated
and if the split key has empty byte array.MasterNotRunningException - if master is not runningTableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence and attempt-at-creation).java.io.IOExceptionvoid createTableAsync(HTableDescriptor desc, byte[][] splitKeys) throws java.io.IOException
isTableAvailable(org.apache.hadoop.hbase.TableName) -- it is not safe to create an
HTable instance to this table before it is available. Note : Avoid passing empty split key.desc - table descriptor for tablejava.lang.IllegalArgumentException - Bad table name, if the split keys are repeated and if the
split key has empty byte array.MasterNotRunningException - if master is not runningTableExistsException - if table already exists (If concurrent
threads, the table may have been created between test-for-existence and attempt-at-creation).java.io.IOExceptionvoid deleteTable(TableName tableName) throws java.io.IOException
tableName - name of table to deletejava.io.IOException - if a remote or network exception occursHTableDescriptor[] deleteTables(java.lang.String regex) throws java.io.IOException
listTables(java.lang.String) and deleteTable(org.apache.hadoop.hbase.TableName)regex - The regular expression to match table names againstjava.io.IOExceptiondeleteTables(java.util.regex.Pattern),
deleteTable(org.apache.hadoop.hbase.TableName)HTableDescriptor[] deleteTables(java.util.regex.Pattern pattern) throws java.io.IOException
listTables(java.util.regex.Pattern) and
deleteTable(org.apache.hadoop.hbase.TableName)pattern - The pattern to match table names againstjava.io.IOExceptionvoid truncateTable(TableName tableName, boolean preserveSplits) throws java.io.IOException
tableName - name of table to truncatepreserveSplits - True if the splits should be preservedjava.io.IOException - if a remote or network exception occursvoid enableTable(TableName tableName) throws java.io.IOException
enableTableAsync(org.apache.hadoop.hbase.TableName)
and isTableEnabled(org.apache.hadoop.hbase.TableName) instead. The table has to be in
disabled state for it to be enabled.tableName - name of the tablejava.io.IOException - if a remote or network exception occurs There could be couple types of
IOException TableNotFoundException means the table doesn't exist. TableNotDisabledException
means the table isn't in disabled state.isTableEnabled(org.apache.hadoop.hbase.TableName),
disableTable(org.apache.hadoop.hbase.TableName),
enableTableAsync(org.apache.hadoop.hbase.TableName)void enableTableAsync(TableName tableName) throws java.io.IOException
isTableEnabled(org.apache.hadoop.hbase.TableName) to learn
when table is fully online. If table is taking too long to online, check server logs.tableName - java.io.IOExceptionHTableDescriptor[] enableTables(java.lang.String regex) throws java.io.IOException
listTables(java.lang.String) and enableTable(org.apache.hadoop.hbase.TableName)regex - The regular expression to match table names againstjava.io.IOExceptionenableTables(java.util.regex.Pattern),
enableTable(org.apache.hadoop.hbase.TableName)HTableDescriptor[] enableTables(java.util.regex.Pattern pattern) throws java.io.IOException
listTables(java.util.regex.Pattern) and
enableTable(org.apache.hadoop.hbase.TableName)pattern - The pattern to match table names againstjava.io.IOExceptionvoid disableTableAsync(TableName tableName) throws java.io.IOException
isTableDisabled(org.apache.hadoop.hbase.TableName) to check for when disable completes. If
table is taking too long to online, check server logs.tableName - name of tablejava.io.IOException - if a remote or network exception occursisTableDisabled(org.apache.hadoop.hbase.TableName),
isTableEnabled(org.apache.hadoop.hbase.TableName)void disableTable(TableName tableName) throws java.io.IOException
disableTableAsync(org.apache.hadoop.hbase.TableName) and
isTableDisabled(org.apache.hadoop.hbase.TableName) instead. The table has to be in
enabled state for it to be disabled.tableName - java.io.IOException - There could be couple types of IOException TableNotFoundException means the
table doesn't exist. TableNotEnabledException means the table isn't in enabled state.HTableDescriptor[] disableTables(java.lang.String regex) throws java.io.IOException
listTables(java.lang.String) and disableTable(org.apache.hadoop.hbase.TableName)regex - The regular expression to match table names againstjava.io.IOExceptiondisableTables(java.util.regex.Pattern),
disableTable(org.apache.hadoop.hbase.TableName)HTableDescriptor[] disableTables(java.util.regex.Pattern pattern) throws java.io.IOException
listTables(java.util.regex.Pattern) and
disableTable(org.apache.hadoop.hbase.TableName)pattern - The pattern to match table names againstjava.io.IOExceptionboolean isTableEnabled(TableName tableName) throws java.io.IOException
tableName - name of table to checkjava.io.IOException - if a remote or network exception occursboolean isTableDisabled(TableName tableName) throws java.io.IOException
tableName - name of table to checkjava.io.IOException - if a remote or network exception occursboolean isTableAvailable(TableName tableName) throws java.io.IOException
tableName - name of table to checkjava.io.IOException - if a remote or network exception occursboolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws java.io.IOException
tableName - name of table to checksplitKeys - keys to check if the table has been created with all split keysjava.io.IOException - if a remote or network excpetion occursPair<java.lang.Integer,java.lang.Integer> getAlterStatus(TableName tableName) throws java.io.IOException
tableName - TableName instancejava.io.IOException - if a remote or network exception occursPair<java.lang.Integer,java.lang.Integer> getAlterStatus(byte[] tableName) throws java.io.IOException
tableName - name of the table to get the status ofjava.io.IOException - if a remote or network exception occursvoid addColumn(TableName tableName, HColumnDescriptor column) throws java.io.IOException
tableName - name of the table to add column tocolumn - column descriptor of column to be addedjava.io.IOException - if a remote or network exception occursvoid deleteColumn(TableName tableName, byte[] columnName) throws java.io.IOException
tableName - name of tablecolumnName - name of column to be deletedjava.io.IOException - if a remote or network exception occursvoid modifyColumn(TableName tableName, HColumnDescriptor descriptor) throws java.io.IOException
tableName - name of tabledescriptor - new column descriptor to usejava.io.IOException - if a remote or network exception occursvoid closeRegion(java.lang.String regionname,
java.lang.String serverName)
throws java.io.IOException
regionname - region name to closeserverName - If supplied, we'll use this location rather than the one currently in
hbase:metajava.io.IOException - if a remote or network exception occursvoid closeRegion(byte[] regionname,
java.lang.String serverName)
throws java.io.IOException
regionname - region name to closeserverName - The servername of the regionserver. If passed null we will use servername
found in the hbase:meta table. A server name is made of host, port and startcode. Here is an
example: host187.example.com,60020,1289493121758java.io.IOException - if a remote or network exception occursboolean closeRegionWithEncodedRegionName(java.lang.String encodedRegionName,
java.lang.String serverName)
throws java.io.IOException
encodedRegionName - The encoded region name; i.e. the hash that makes up the region name
suffix: e.g. if regionname is
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.,
then the encoded region name is: 527db22f95c8a9e0116f0cc13c680396.serverName - The servername of the regionserver. A server name is made of host, port and
startcode. This is mandatory. Here is an example:
host187.example.com,60020,1289493121758java.io.IOException - if a remote or network exception occursvoid closeRegion(ServerName sn, HRegionInfo hri) throws java.io.IOException
sn - hri - java.io.IOExceptionjava.util.List<HRegionInfo> getOnlineRegions(ServerName sn) throws java.io.IOException
java.io.IOExceptionvoid flush(TableName tableName) throws java.io.IOException
tableName - table to flushjava.io.IOException - if a remote or network exception occursvoid flushRegion(byte[] regionName)
throws java.io.IOException
regionName - region to flushjava.io.IOException - if a remote or network exception occursvoid compact(TableName tableName) throws java.io.IOException
tableName - table to compactjava.io.IOException - if a remote or network exception occursvoid compactRegion(byte[] regionName)
throws java.io.IOException
regionName - region to compactjava.io.IOException - if a remote or network exception occursvoid compact(TableName tableName, byte[] columnFamily) throws java.io.IOException
tableName - table to compactcolumnFamily - column family within a tablejava.io.IOException - if a remote or network exception occursvoid compactRegion(byte[] regionName,
byte[] columnFamily)
throws java.io.IOException
regionName - region to compactcolumnFamily - column family within a regionjava.io.IOException - if a remote or network exception occursvoid majorCompact(TableName tableName) throws java.io.IOException
tableName - table to major compactjava.io.IOException - if a remote or network exception occursvoid majorCompactRegion(byte[] regionName)
throws java.io.IOException
regionName - region to major compactjava.io.IOException - if a remote or network exception occursvoid majorCompact(TableName tableName, byte[] columnFamily) throws java.io.IOException
tableName - table to major compactcolumnFamily - column family within a tablejava.io.IOException - if a remote or network exception occursvoid majorCompactRegion(byte[] regionName,
byte[] columnFamily)
throws java.io.IOException
regionName - egion to major compactcolumnFamily - column family within a regionjava.io.IOException - if a remote or network exception occursvoid compactRegionServer(ServerName sn, boolean major) throws java.io.IOException, java.lang.InterruptedException
sn - the region server namemajor - if it's major compactionjava.io.IOExceptionjava.lang.InterruptedExceptionvoid move(byte[] encodedRegionName,
byte[] destServerName)
throws java.io.IOException
r to dest.encodedRegionName - The encoded region name; i.e. the hash that makes up the region name
suffix: e.g. if regionname is
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.,
then the encoded region name is: 527db22f95c8a9e0116f0cc13c680396.destServerName - The servername of the destination regionserver. If passed the empty byte
array we'll assign to a random server. A server name is made of host, port and startcode.
Here is an example: host187.example.com,60020,1289493121758UnknownRegionException - Thrown if we can't find a region named
encodedRegionNamejava.io.IOExceptionvoid assign(byte[] regionName)
throws java.io.IOException
regionName - Region name to assign.java.io.IOExceptionvoid unassign(byte[] regionName,
boolean force)
throws java.io.IOException
move(byte[], byte[]) if you want to control the region movement.regionName - Region to unassign. Will clear any existing RegionPlan if one found.force - If true, force unassign (Will remove region from regions-in-transition too if
present. If results in double assignment use hbck -fix to resolve. To be used by experts).java.io.IOExceptionvoid offline(byte[] regionName)
throws java.io.IOException
regionName - Region to offline.java.io.IOExceptionboolean setBalancerRunning(boolean on,
boolean synchronous)
throws java.io.IOException
synchronous - If true, it waits until current balance() call, if outstanding, to return.java.io.IOExceptionboolean balancer()
throws java.io.IOException
java.io.IOExceptionboolean balancer(boolean force)
throws java.io.IOException
force - whether we should force balance even if there is region in transitionjava.io.IOExceptionboolean isBalancerEnabled()
throws java.io.IOException
java.io.IOExceptionboolean normalize()
throws java.io.IOException
java.io.IOExceptionboolean isNormalizerEnabled()
throws java.io.IOException
java.io.IOExceptionboolean setNormalizerRunning(boolean on)
throws java.io.IOException
java.io.IOExceptionboolean enableCatalogJanitor(boolean enable)
throws java.io.IOException
enable - if true enables the catalog janitorjava.io.IOExceptionint runCatalogScan()
throws java.io.IOException
java.io.IOExceptionboolean isCatalogJanitorEnabled()
throws java.io.IOException
java.io.IOExceptionvoid mergeRegions(byte[] encodedNameOfRegionA,
byte[] encodedNameOfRegionB,
boolean forcible)
throws java.io.IOException
encodedNameOfRegionA - encoded name of region aencodedNameOfRegionB - encoded name of region bforcible - true if do a compulsory merge, otherwise we will only merge two adjacent
regionsjava.io.IOExceptionvoid split(TableName tableName) throws java.io.IOException
tableName - table to splitjava.io.IOException - if a remote or network exception occursvoid splitRegion(byte[] regionName)
throws java.io.IOException
regionName - region to splitjava.io.IOException - if a remote or network exception occursvoid split(TableName tableName, byte[] splitPoint) throws java.io.IOException
tableName - table to splitsplitPoint - the explicit position to split onjava.io.IOException - if a remote or network exception occursvoid splitRegion(byte[] regionName,
byte[] splitPoint)
throws java.io.IOException
regionName - region to splitsplitPoint - the explicit position to split onjava.io.IOException - if a remote or network exception occursvoid modifyTable(TableName tableName, HTableDescriptor htd) throws java.io.IOException
tableName - name of table.htd - modified description of the tablejava.io.IOException - if a remote or network exception occursvoid shutdown()
throws java.io.IOException
java.io.IOException - if a remote or network exception occursvoid stopMaster()
throws java.io.IOException
java.io.IOException - if a remote or network exception occursshutdown()boolean isMasterInMaintenanceMode()
throws java.io.IOException
java.io.IOException - if a remote or network exception occursvoid stopRegionServer(java.lang.String hostnamePort)
throws java.io.IOException
hostnamePort - Hostname and port delimited by a : as in
example.org:1234java.io.IOException - if a remote or network exception occursClusterStatus getClusterStatus() throws java.io.IOException
java.io.IOException - if a remote or network exception occursConfiguration getConfiguration()
void createNamespace(NamespaceDescriptor descriptor) throws java.io.IOException
descriptor - descriptor which describes the new namespacejava.io.IOExceptionvoid modifyNamespace(NamespaceDescriptor descriptor) throws java.io.IOException
descriptor - descriptor which describes the new namespacejava.io.IOExceptionvoid deleteNamespace(java.lang.String name)
throws java.io.IOException
name - namespace namejava.io.IOExceptionNamespaceDescriptor getNamespaceDescriptor(java.lang.String name) throws java.io.IOException
name - name of namespace descriptorjava.io.IOExceptionNamespaceDescriptor[] listNamespaceDescriptors() throws java.io.IOException
java.io.IOExceptionHTableDescriptor[] listTableDescriptorsByNamespace(java.lang.String name) throws java.io.IOException
name - namespace namejava.io.IOExceptionTableName[] listTableNamesByNamespace(java.lang.String name) throws java.io.IOException
name - namespace namejava.io.IOExceptionjava.util.List<HRegionInfo> getTableRegions(TableName tableName) throws java.io.IOException
tableName - the name of the tableHRegionInfo.java.io.IOExceptionvoid close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionHTableDescriptor[] getTableDescriptorsByTableName(java.util.List<TableName> tableNames) throws java.io.IOException
tableNames - List of table namesjava.io.IOException - if a remote or network exception occursHTableDescriptor[] getTableDescriptors(java.util.List<java.lang.String> names) throws java.io.IOException
names - List of table namesjava.io.IOException - if a remote or network exception occursboolean abortProcedure(long procId,
boolean mayInterruptIfRunning)
throws java.io.IOException
procId - ID of the procedure to abortmayInterruptIfRunning - if the proc completed at least one step, should it be aborted?java.io.IOExceptionProcedureInfo[] listProcedures() throws java.io.IOException
java.io.IOExceptionjava.util.concurrent.Future<java.lang.Boolean> abortProcedureAsync(long procId,
boolean mayInterruptIfRunning)
throws java.io.IOException
procId - ID of the procedure to abortmayInterruptIfRunning - if the proc completed at least one step, should it be aborted?java.io.IOExceptionvoid rollWALWriter(ServerName serverName) throws java.io.IOException, FailedLogCloseException
serverName - The servername of the regionserver.java.io.IOException - if a remote or network exception occursFailedLogCloseExceptionjava.lang.String[] getMasterCoprocessors()
throws java.io.IOException
java.io.IOExceptionClusterStatus.getMasterCoprocessors()AdminProtos.GetRegionInfoResponse.CompactionState getCompactionState(TableName tableName) throws java.io.IOException
tableName - table to examinejava.io.IOException - if a remote or network exception occursAdminProtos.GetRegionInfoResponse.CompactionState getCompactionStateForRegion(byte[] regionName) throws java.io.IOException
regionName - region to examinejava.io.IOException - if a remote or network exception occurslong getLastMajorCompactionTimestamp(TableName tableName) throws java.io.IOException
tableName - table to examinejava.io.IOException - if a remote or network exception occurslong getLastMajorCompactionTimestampForRegion(byte[] regionName)
throws java.io.IOException
regionName - region to examinejava.io.IOException - if a remote or network exception occursvoid snapshot(java.lang.String snapshotName,
TableName tableName)
throws java.io.IOException,
SnapshotCreationException,
java.lang.IllegalArgumentException
SnapshotCreationException indicating the duplicate naming.
Snapshot names follow the same naming constraints as tables in HBase. See TableName.isLegalFullyQualifiedTableName(byte[]).snapshotName - name of the snapshot to be createdtableName - name of the table for which snapshot is createdjava.io.IOException - if a remote or network exception occursSnapshotCreationException - if snapshot creation failedjava.lang.IllegalArgumentException - if the snapshot request is formatted incorrectlyvoid snapshot(byte[] snapshotName,
TableName tableName)
throws java.io.IOException,
SnapshotCreationException,
java.lang.IllegalArgumentException
SnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in
HBase.snapshotName - name of the snapshot to be createdtableName - name of the table for which snapshot is createdjava.io.IOException - if a remote or network exception occursSnapshotCreationException - if snapshot creation failedjava.lang.IllegalArgumentException - if the snapshot request is formatted incorrectlyvoid snapshot(java.lang.String snapshotName,
TableName tableName,
HBaseProtos.SnapshotDescription.Type type)
throws java.io.IOException,
SnapshotCreationException,
java.lang.IllegalArgumentException
SnapshotCreationException indicating the
duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. See
TableName.isLegalFullyQualifiedTableName(byte[]).snapshotName - name to give the snapshot on the filesystem. Must be unique from all other
snapshots stored on the clustertableName - name of the table to snapshottype - type of snapshot to takejava.io.IOException - we fail to reach the masterSnapshotCreationException - if snapshot creation failedjava.lang.IllegalArgumentException - if the snapshot request is formatted incorrectlyvoid snapshot(HBaseProtos.SnapshotDescription snapshot) throws java.io.IOException, SnapshotCreationException, java.lang.IllegalArgumentException
SnapshotCreationException indicating the duplicate naming.
Snapshot names follow the same naming constraints as tables in HBase. See TableName.isLegalFullyQualifiedTableName(byte[]). You should probably
use snapshot(String, org.apache.hadoop.hbase.TableName) or
snapshot(byte[], org.apache.hadoop.hbase.TableName) unless you are sure about the type
of snapshot that you want to take.snapshot - snapshot to takejava.io.IOException - or we lose contact with the master.SnapshotCreationException - if snapshot failed to be takenjava.lang.IllegalArgumentException - if the snapshot request is formatted incorrectlyMasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot) throws java.io.IOException, SnapshotCreationException
snapshot - snapshot to takejava.io.IOException - if the snapshot did not succeed or we lose contact with the master.SnapshotCreationException - if snapshot creation failedjava.lang.IllegalArgumentException - if the snapshot request is formatted incorrectlyboolean isSnapshotFinished(HBaseProtos.SnapshotDescription snapshot) throws java.io.IOException, HBaseSnapshotException, UnknownSnapshotException
UnknownSnapshotException.snapshot - description of the snapshot to checkjava.io.IOException - if we have a network issueHBaseSnapshotException - if the snapshot failedUnknownSnapshotException - if the requested snapshot is
unknownvoid restoreSnapshot(byte[] snapshotName)
throws java.io.IOException,
RestoreSnapshotException
snapshotName - name of the snapshot to restorejava.io.IOException - if a remote or network exception occursRestoreSnapshotException - if snapshot failed to be
restoredjava.lang.IllegalArgumentException - if the restore request is formatted incorrectlyvoid restoreSnapshot(java.lang.String snapshotName)
throws java.io.IOException,
RestoreSnapshotException
snapshotName - name of the snapshot to restorejava.io.IOException - if a remote or network exception occursRestoreSnapshotException - if snapshot failed to be restoredjava.lang.IllegalArgumentException - if the restore request is formatted incorrectlyvoid restoreSnapshot(byte[] snapshotName,
boolean takeFailSafeSnapshot)
throws java.io.IOException,
RestoreSnapshotException
snapshotName - name of the snapshot to restoretakeFailSafeSnapshot - true if the failsafe snapshot should be takenjava.io.IOException - if a remote or network exception occursRestoreSnapshotException - if snapshot failed to be restoredjava.lang.IllegalArgumentException - if the restore request is formatted incorrectlyvoid restoreSnapshot(java.lang.String snapshotName,
boolean takeFailSafeSnapshot)
throws java.io.IOException,
RestoreSnapshotException
snapshotName - name of the snapshot to restoretakeFailSafeSnapshot - true if the failsafe snapshot should be takenjava.io.IOException - if a remote or network exception occursRestoreSnapshotException - if snapshot failed to be restoredjava.lang.IllegalArgumentException - if the restore request is formatted incorrectlyvoid restoreSnapshot(java.lang.String snapshotName,
boolean takeFailSafeSnapshot,
boolean restoreAcl)
throws java.io.IOException,
RestoreSnapshotException
snapshotName - name of the snapshot to restoretakeFailSafeSnapshot - true if the failsafe snapshot should be takenrestoreAcl - true to restore acl of snapshot into table.java.io.IOException - if a remote or network exception occursRestoreSnapshotException - if snapshot failed to be restoredjava.lang.IllegalArgumentException - if the restore request is formatted incorrectlyvoid cloneSnapshot(byte[] snapshotName,
TableName tableName)
throws java.io.IOException,
TableExistsException,
RestoreSnapshotException
snapshotName - name of the snapshot to be clonedtableName - name of the table where the snapshot will be restoredjava.io.IOException - if a remote or network exception occursTableExistsException - if table to be created already existsRestoreSnapshotException - if snapshot failed to be clonedjava.lang.IllegalArgumentException - if the specified table has not a valid namevoid cloneSnapshot(java.lang.String snapshotName,
TableName tableName)
throws java.io.IOException,
TableExistsException,
RestoreSnapshotException
snapshotName - name of the snapshot to be clonedtableName - name of the table where the snapshot will be restoredjava.io.IOException - if a remote or network exception occursTableExistsException - if table to be created already existsRestoreSnapshotException - if snapshot failed to be clonedjava.lang.IllegalArgumentException - if the specified table has not a valid namevoid cloneSnapshot(java.lang.String snapshotName,
TableName tableName,
boolean restoreAcl)
throws java.io.IOException,
TableExistsException,
RestoreSnapshotException
snapshotName - name of the snapshot to be clonedtableName - name of the table where the snapshot will be restoredrestoreAcl - true to restore acl of snapshot into newly created tablejava.io.IOException - if a remote or network exception occursTableExistsException - if table to be created already existsRestoreSnapshotException - if snapshot failed to be clonedjava.lang.IllegalArgumentException - if the specified table has not a valid namevoid execProcedure(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
throws java.io.IOException
signature - A distributed procedure is uniquely identified by its signature (default the
root ZK node name of the procedure).instance - The instance name of the procedure. For some procedures, this parameter is
optional.props - Property/Value pairs of properties passing to the procedurejava.io.IOExceptionbyte[] execProcedureWithRet(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
throws java.io.IOException
signature - A distributed procedure is uniquely identified by its signature (default the
root ZK node name of the procedure).instance - The instance name of the procedure. For some procedures, this parameter is
optional.props - Property/Value pairs of properties passing to the procedurejava.io.IOExceptionboolean isProcedureFinished(java.lang.String signature,
java.lang.String instance,
java.util.Map<java.lang.String,java.lang.String> props)
throws java.io.IOException
signature - The signature that uniquely identifies a procedureinstance - The instance name of the procedureprops - Property/Value pairs of properties passing to the procedurejava.io.IOException - if the specified procedure finished with errorjava.util.List<HBaseProtos.SnapshotDescription> listSnapshots() throws java.io.IOException
java.io.IOException - if a network error occursjava.util.List<HBaseProtos.SnapshotDescription> listSnapshots(java.lang.String regex) throws java.io.IOException
regex - The regular expression to match againstjava.io.IOException - if a remote or network exception occursjava.util.List<HBaseProtos.SnapshotDescription> listSnapshots(java.util.regex.Pattern pattern) throws java.io.IOException
pattern - The compiled regular expression to match againstjava.io.IOException - if a remote or network exception occursvoid deleteSnapshot(byte[] snapshotName)
throws java.io.IOException
snapshotName - name of the snapshotjava.io.IOException - if a remote or network exception occursvoid deleteSnapshot(java.lang.String snapshotName)
throws java.io.IOException
snapshotName - name of the snapshotjava.io.IOException - if a remote or network exception occursvoid deleteSnapshots(java.lang.String regex)
throws java.io.IOException
regex - The regular expression to match againstjava.io.IOException - if a remote or network exception occursvoid deleteSnapshots(java.util.regex.Pattern pattern)
throws java.io.IOException
pattern - pattern for names of the snapshot to matchjava.io.IOException - if a remote or network exception occursvoid setQuota(QuotaSettings quota) throws java.io.IOException
quota - the quota settingsjava.io.IOException - if a remote or network exception occursQuotaRetriever getQuotaRetriever(QuotaFilter filter) throws java.io.IOException
filter - the quota settings filterjava.io.IOException - if a remote or network exception occursCoprocessorRpcChannel coprocessorService()
com.google.protobuf.RpcChannel instance connected to the active
master. The obtained com.google.protobuf.RpcChannel instance can be used to access
a published coprocessor com.google.protobuf.Service using standard protobuf service
invocations:
CoprocessorRpcChannel channel = myAdmin.coprocessorService();
MyService.BlockingInterface service = MyService.newBlockingStub(channel);
MyCallRequest request = MyCallRequest.newBuilder()
...
.build();
MyCallResponse response = service.myCall(null, request);
CoprocessorRpcChannel coprocessorService(ServerName sn)
com.google.protobuf.RpcChannel instance
connected to the passed region server.
The obtained com.google.protobuf.RpcChannel instance can be used to access a published
coprocessor com.google.protobuf.Service using standard protobuf service invocations:
CoprocessorRpcChannel channel = myAdmin.coprocessorService(serverName);
MyService.BlockingInterface service = MyService.newBlockingStub(channel);
MyCallRequest request = MyCallRequest.newBuilder()
...
.build();
MyCallResponse response = service.myCall(null, request);
sn - the server name to which the endpoint call is madevoid updateConfiguration(ServerName server) throws java.io.IOException
server - : The server whose config needs to be updated.java.io.IOExceptionvoid updateConfiguration()
throws java.io.IOException
java.io.IOExceptionint getMasterInfoPort()
throws java.io.IOException
java.io.IOExceptionvoid compact(TableName tableName, Admin.CompactType compactType) throws java.io.IOException, java.lang.InterruptedException
tableName - table to compactcompactType - Admin.CompactTypejava.io.IOExceptionjava.lang.InterruptedExceptionvoid compact(TableName tableName, byte[] columnFamily, Admin.CompactType compactType) throws java.io.IOException, java.lang.InterruptedException
tableName - table to compactcolumnFamily - column family within a tablecompactType - Admin.CompactTypejava.io.IOException - if not a mob column family or if a remote or network exception occursjava.lang.InterruptedExceptionvoid majorCompact(TableName tableName, Admin.CompactType compactType) throws java.io.IOException, java.lang.InterruptedException
tableName - table to compactcompactType - Admin.CompactTypejava.io.IOExceptionjava.lang.InterruptedExceptionvoid majorCompact(TableName tableName, byte[] columnFamily, Admin.CompactType compactType) throws java.io.IOException, java.lang.InterruptedException
tableName - table to compactcolumnFamily - column family within a tablecompactType - Admin.CompactTypejava.io.IOException - if not a mob column family or if a remote or network exception occursjava.lang.InterruptedExceptionAdminProtos.GetRegionInfoResponse.CompactionState getCompactionState(TableName tableName, Admin.CompactType compactType) throws java.io.IOException
tableName - table to examinecompactType - Admin.CompactTypejava.io.IOException - if a remote or network exception occursBackupAdmin getBackupAdmin() throws java.io.IOException
java.io.IOException - exceptionboolean[] setSplitOrMergeEnabled(boolean enabled,
boolean synchronous,
Admin.MasterSwitchType... switchTypes)
throws java.io.IOException
enabled - enabled or notsynchronous - If true, it waits until current split() call, if outstanding, to return.switchTypes - switchType list Admin.MasterSwitchTypejava.io.IOExceptionboolean isSplitOrMergeEnabled(Admin.MasterSwitchType switchType) throws java.io.IOException
java.io.IOException