@InterfaceAudience.Private public class ThriftAdmin extends Object implements Admin
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client |
client |
private org.apache.hadoop.conf.Configuration |
conf |
private int |
operationTimeout |
private int |
syncWaitTimeout |
private org.apache.thrift.transport.TTransport |
transport |
Constructor and Description |
---|
ThriftAdmin(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client,
org.apache.thrift.transport.TTransport tTransport,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
boolean |
abortProcedure(long procId,
boolean mayInterruptIfRunning)
Abort a procedure.
|
Future<Boolean> |
abortProcedureAsync(long procId,
boolean mayInterruptIfRunning)
Abort a procedure but does not block and wait for completion.
|
void |
addColumnFamily(TableName tableName,
ColumnFamilyDescriptor columnFamily)
Add a column family to an existing table.
|
Future<Void> |
addColumnFamilyAsync(TableName tableName,
ColumnFamilyDescriptor columnFamily)
Add a column family to an existing table.
|
Future<Void> |
addReplicationPeerAsync(String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
Add a new replication peer but does not block and wait for it.
|
void |
assign(byte[] regionName)
Assign a Region.
|
boolean |
balance()
Invoke the balancer.
|
BalanceResponse |
balance(BalanceRequest request)
Invoke the balancer with the given balance request.
|
boolean |
balance(boolean force)
Invoke the balancer.
|
boolean |
balancerSwitch(boolean onOrOff,
boolean synchronous)
Turn the load balancer on or off.
|
boolean |
catalogJanitorSwitch(boolean onOrOff)
Enable/Disable the catalog janitor/
|
boolean |
cleanerChoreSwitch(boolean onOrOff)
Enable/Disable the cleaner chore.
|
CacheEvictionStats |
clearBlockCache(TableName tableName)
Clear all the blocks corresponding to this table from BlockCache.
|
void |
clearCompactionQueues(ServerName serverName,
Set<String> queues)
Clear compacting queues on a regionserver.
|
List<ServerName> |
clearDeadServers(List<ServerName> servers)
Clear dead region servers from master.
|
List<Boolean> |
clearSlowLogResponses(Set<ServerName> serverNames)
Clears online slow/large RPC logs from the provided list of RegionServers
|
Future<Void> |
cloneSnapshotAsync(String snapshotName,
TableName tableName,
boolean cloneAcl,
String customSFT)
Create a new table by cloning the snapshot content.
|
void |
cloneTableSchema(TableName tableName,
TableName newTableName,
boolean preserveSplits)
Create a new table by cloning the existent table schema.
|
void |
close() |
void |
closeRegion(byte[] regionname,
String serverName)
Uses
Admin.unassign(byte[], boolean) to unassign the region. |
void |
closeRegion(ServerName sn,
HRegionInfo hri)
Used
Admin.unassign(byte[], boolean) to unassign the region. |
void |
closeRegion(String regionname,
String serverName)
Uses
Admin.unassign(byte[], boolean) to unassign the region. |
boolean |
closeRegionWithEncodedRegionName(String encodedRegionName,
String serverName)
Uses
Admin.unassign(byte[], boolean) to unassign the region. |
void |
compact(TableName tableName)
Compact a table.
|
void |
compact(TableName tableName,
byte[] columnFamily)
Compact a column family within a table.
|
void |
compact(TableName tableName,
byte[] columnFamily,
CompactType compactType)
Compact a column family within a table.
|
void |
compact(TableName tableName,
CompactType compactType)
Compact a table.
|
Map<ServerName,Boolean> |
compactionSwitch(boolean switchState,
List<String> serverNamesList)
Turn the compaction on or off.
|
void |
compactRegion(byte[] regionName)
Compact an individual region.
|
void |
compactRegion(byte[] regionName,
byte[] columnFamily)
Compact a column family within a region.
|
void |
compactRegionServer(ServerName serverName)
Compact all regions on the region server.
|
CoprocessorRpcChannel |
coprocessorService()
Creates and returns a
RpcChannel instance connected to the active
master. |
CoprocessorRpcChannel |
coprocessorService(ServerName serverName)
Creates and returns a
RpcChannel instance connected to the passed
region server. |
void |
createNamespace(NamespaceDescriptor descriptor)
Create a new namespace.
|
Future<Void> |
createNamespaceAsync(NamespaceDescriptor descriptor)
Create a new namespace.
|
void |
createTable(TableDescriptor desc)
Creates a new table.
|
void |
createTable(TableDescriptor desc,
byte[][] splitKeys)
Creates a new table with an initial set of empty regions defined by the specified split keys.
|
void |
createTable(TableDescriptor desc,
byte[] startKey,
byte[] endKey,
int numRegions)
Creates a new table with the specified number of regions.
|
Future<Void> |
createTableAsync(TableDescriptor desc)
Creates a new table but does not block and wait for it to come online.
|
Future<Void> |
createTableAsync(TableDescriptor desc,
byte[][] splitKeys)
Creates a new table but does not block and wait for it to come online.
|
void |
decommissionRegionServers(List<ServerName> servers,
boolean offload)
Mark region server(s) as decommissioned to prevent additional regions from getting assigned to
them.
|
void |
deleteColumn(TableName tableName,
byte[] columnFamily)
Delete a column family from a table.
|
void |
deleteColumnFamily(TableName tableName,
byte[] columnFamily)
Delete a column family from a table.
|
Future<Void> |
deleteColumnFamilyAsync(TableName tableName,
byte[] columnFamily)
Delete a column family from a table.
|
void |
deleteNamespace(String name)
Delete an existing namespace.
|
Future<Void> |
deleteNamespaceAsync(String name)
Delete an existing namespace.
|
void |
deleteSnapshot(byte[] snapshotName)
Delete an existing snapshot.
|
void |
deleteSnapshot(String snapshotName)
Delete an existing snapshot.
|
void |
deleteSnapshots(Pattern pattern)
Delete existing snapshots whose names match the pattern passed.
|
void |
deleteSnapshots(String regex)
Delete existing snapshots whose names match the pattern passed.
|
void |
deleteTable(TableName tableName)
Deletes a table.
|
Future<Void> |
deleteTableAsync(TableName tableName)
Deletes the table but does not block and wait for it to be completely removed.
|
HTableDescriptor[] |
deleteTables(Pattern pattern)
Delete tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
deleteTables(String regex)
Deletes tables matching the passed in pattern and wait on completion.
|
void |
deleteTableSnapshots(Pattern tableNamePattern,
Pattern snapshotNamePattern)
Delete all existing snapshots matching the given table name regular expression and snapshot
name regular expression.
|
void |
deleteTableSnapshots(String tableNameRegex,
String snapshotNameRegex)
Delete all existing snapshots matching the given table name regular expression and snapshot
name regular expression.
|
Future<Void> |
disableReplicationPeerAsync(String peerId)
Disable a replication peer but does not block and wait for it.
|
void |
disableTable(TableName tableName)
Disable table and wait on completion.
|
Future<Void> |
disableTableAsync(TableName tableName)
Disable the table but does not block and wait for it to be completely disabled.
|
void |
disableTableReplication(TableName tableName)
Disable a table's replication switch.
|
HTableDescriptor[] |
disableTables(Pattern pattern)
Disable tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
disableTables(String regex)
Disable tables matching the passed in pattern and wait on completion.
|
Future<Void> |
enableReplicationPeerAsync(String peerId)
Enable a replication peer but does not block and wait for it.
|
void |
enableTable(TableName tableName)
Enable a table.
|
Future<Void> |
enableTableAsync(TableName tableName)
Enable the table but does not block and wait for it to be completely enabled.
|
void |
enableTableReplication(TableName tableName)
Enable a table's replication switch.
|
HTableDescriptor[] |
enableTables(Pattern pattern)
Enable tables matching the passed in pattern and wait on completion.
|
HTableDescriptor[] |
enableTables(String regex)
Enable tables matching the passed in pattern and wait on completion.
|
boolean |
exceedThrottleQuotaSwitch(boolean enable)
Switch the exceed throttle quota.
|
void |
execProcedure(String signature,
String instance,
Map<String,String> props)
Execute a distributed procedure on a cluster.
|
byte[] |
execProcedureWithReturn(String signature,
String instance,
Map<String,String> props)
Execute a distributed procedure on a cluster.
|
void |
flush(TableName tableName)
Flush a table.
|
void |
flush(TableName tableName,
byte[] columnFamily)
Flush the specified column family stores on all regions of the passed table.
|
void |
flushMasterStore()
Flush master local region
|
void |
flushRegion(byte[] regionName)
Flush an individual region.
|
void |
flushRegion(byte[] regionName,
byte[] columnFamily)
Flush a column family within a region.
|
void |
flushRegionServer(ServerName serverName)
Flush all regions on the region server.
|
Pair<Integer,Integer> |
getAlterStatus(byte[] tableName)
Get the status of
alter (a.k.a modify ) command - indicates how many
regions have received the updated schema Asynchronous operation. |
Pair<Integer,Integer> |
getAlterStatus(TableName tableName)
Get the status of an
alter (a.k.a modify ) command - indicates how
many regions have received the updated schema Asynchronous operation. |
ClusterMetrics |
getClusterMetrics(EnumSet<ClusterMetrics.Option> options)
Get cluster status with a set of
ClusterMetrics.Option to get desired status. |
CompactionState |
getCompactionState(TableName tableName)
Get the current compaction state of a table.
|
CompactionState |
getCompactionState(TableName tableName,
CompactType compactType)
Get the current compaction state of a table.
|
CompactionState |
getCompactionStateForRegion(byte[] regionName)
Get the current compaction state of region.
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns Configuration used by the instance.
|
Connection |
getConnection()
Returns Connection used by this object.
|
SpaceQuotaSnapshot |
getCurrentSpaceQuotaSnapshot(String namespace)
Returns the Master's view of a quota on the given
namespace or null if the Master has
no quota information on that namespace. |
SpaceQuotaSnapshot |
getCurrentSpaceQuotaSnapshot(TableName tableName)
Returns the Master's view of a quota on the given
tableName or null if the Master has
no quota information on that table. |
TableDescriptor |
getDescriptor(TableName tableName)
Get a table descriptor.
|
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.
|
String |
getLocks()
Get locks.
|
List<LogEntry> |
getLogEntries(Set<ServerName> serverNames,
String logType,
ServerType serverType,
int limit,
Map<String,Object> filterParams)
Retrieve recent online records from HMaster / RegionServers.
|
NamespaceDescriptor |
getNamespaceDescriptor(String name)
Get a namespace descriptor by name.
|
List<HRegionInfo> |
getOnlineRegions(ServerName sn)
Get all the online regions on a region server.
|
int |
getOperationTimeout()
Return the operation timeout for a rpc call.
|
String |
getProcedures()
Get procedures.
|
List<QuotaSettings> |
getQuota(QuotaFilter filter)
List the quotas based on the filter.
|
QuotaRetriever |
getQuotaRetriever(QuotaFilter filter)
Return a QuotaRetriever to list the quotas based on the filter.
|
List<RegionMetrics> |
getRegionMetrics(ServerName serverName,
TableName tableName)
Get
RegionMetrics of all regions hosted on a regionserver for a table. |
List<RegionInfo> |
getRegions(ServerName serverName)
Get all the online regions on a region server.
|
List<RegionInfo> |
getRegions(TableName tableName)
Get the regions of a given table.
|
Map<TableName,SpaceQuotaSnapshot> |
getRegionServerSpaceQuotaSnapshots(ServerName serverName)
Fetches the observed
SpaceQuotaSnapshotView s observed by a RegionServer. |
ReplicationPeerConfig |
getReplicationPeerConfig(String peerId)
Returns the configured ReplicationPeerConfig for the specified peer.
|
List<SecurityCapability> |
getSecurityCapabilities()
Return the set of supported security capabilities.
|
List<OnlineLogRecord> |
getSlowLogResponses(Set<ServerName> serverNames,
LogQueryFilter logQueryFilter)
Retrieves online slow/large RPC logs from the provided list of RegionServers
|
Map<TableName,Long> |
getSpaceQuotaTableSizes()
Fetches the table sizes on the filesystem as tracked by the HBase Master.
|
int |
getSyncWaitTimeout()
Return the blocking wait time for an asynchronous operation.
|
HTableDescriptor |
getTableDescriptor(TableName tableName)
Get a table descriptor.
|
HTableDescriptor[] |
getTableDescriptors(List<String> names)
Get tableDescriptors.
|
HTableDescriptor[] |
getTableDescriptorsByTableName(List<TableName> tableNames)
Get tableDescriptors.
|
List<HRegionInfo> |
getTableRegions(TableName tableName)
Get the regions of a given table.
|
List<UserPermission> |
getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest)
Get the global/namespace/table permissions for user
|
void |
grant(UserPermission userPermission,
boolean mergeExistingPermissions)
Grants user specific permissions
|
List<Boolean> |
hasUserPermissions(String userName,
List<Permission> permissions)
Check if the user has specific permissions
|
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 |
isCleanerChoreEnabled()
Query on the cleaner chore state (Enabled/Disabled?).
|
boolean |
isMasterInMaintenanceMode()
Check whether Master is in maintenance mode.
|
boolean |
isMergeEnabled()
Query the current state of the merge switch.
|
boolean |
isNormalizerEnabled()
Query the current state of the region normalizer.
|
boolean |
isProcedureFinished(String signature,
String instance,
Map<String,String> props)
Check the current state of the specified procedure.
|
boolean |
isRpcThrottleEnabled()
Get if the rpc throttle is enabled.
|
boolean |
isSnapshotCleanupEnabled()
Query the current state of the auto snapshot cleanup based on TTL.
|
boolean |
isSnapshotFinished(SnapshotDescription snapshot)
Check the current state of the passed snapshot.
|
boolean |
isSplitEnabled()
Query the current state of the split switch.
|
boolean |
isTableAvailable(TableName tableName)
Check if a table is available.
|
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)
Check if a table is disabled.
|
boolean |
isTableEnabled(TableName tableName)
Check if a table is enabled.
|
List<ServerName> |
listDecommissionedRegionServers()
List region servers marked as decommissioned, which can not be assigned regions.
|
NamespaceDescriptor[] |
listNamespaceDescriptors()
List available namespace descriptors
|
String[] |
listNamespaces()
List available namespaces
|
List<TableCFs> |
listReplicatedTableCFs()
Find all table and column families that are replicated from this cluster
|
List<ReplicationPeerDescription> |
listReplicationPeers()
Return a list of replication peers.
|
List<ReplicationPeerDescription> |
listReplicationPeers(Pattern pattern)
Return a list of replication peers.
|
List<SnapshotDescription> |
listSnapshots()
List completed snapshots.
|
List<SnapshotDescription> |
listSnapshots(Pattern pattern)
List all the completed snapshots matching the given pattern.
|
List<SnapshotDescription> |
listSnapshots(String regex)
List all the completed snapshots matching the given regular expression.
|
List<TableDescriptor> |
listTableDescriptors()
List all the userspace tables.
|
List<TableDescriptor> |
listTableDescriptors(List<TableName> tableNames)
Get tableDescriptors.
|
List<TableDescriptor> |
listTableDescriptors(Pattern pattern)
List all the userspace tables that match the given pattern.
|
List<TableDescriptor> |
listTableDescriptors(Pattern pattern,
boolean includeSysTables)
List all the tables matching the given pattern.
|
List<TableDescriptor> |
listTableDescriptorsByNamespace(byte[] name)
Get list of table descriptors by namespace.
|
HTableDescriptor[] |
listTableDescriptorsByNamespace(String name)
Get list of table descriptors by namespace.
|
TableName[] |
listTableNames()
List all of the names of userspace tables.
|
TableName[] |
listTableNames(Pattern pattern)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(Pattern pattern,
boolean includeSysTables)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(String regex)
List all of the names of userspace tables.
|
TableName[] |
listTableNames(String regex,
boolean includeSysTables)
List all of the names of userspace tables.
|
TableName[] |
listTableNamesByNamespace(String name)
Get list of table names by namespace.
|
HTableDescriptor[] |
listTables()
List all the userspace tables.
|
HTableDescriptor[] |
listTables(Pattern pattern)
List all the userspace tables that match the given pattern.
|
HTableDescriptor[] |
listTables(Pattern pattern,
boolean includeSysTables)
List all the tables matching the given pattern.
|
HTableDescriptor[] |
listTables(String regex)
List all the userspace tables matching the given regular expression.
|
HTableDescriptor[] |
listTables(String regex,
boolean includeSysTables)
List all the tables matching the given pattern.
|
List<SnapshotDescription> |
listTableSnapshots(Pattern tableNamePattern,
Pattern snapshotNamePattern)
List all the completed snapshots matching the given table name regular expression and snapshot
name regular expression.
|
List<SnapshotDescription> |
listTableSnapshots(String tableNameRegex,
String snapshotNameRegex)
List all the completed snapshots matching the given table name regular expression and snapshot
name regular expression.
|
void |
majorCompact(TableName tableName)
Major compact a table.
|
void |
majorCompact(TableName tableName,
byte[] columnFamily)
Major compact a column family within a table.
|
void |
majorCompact(TableName tableName,
byte[] columnFamily,
CompactType compactType)
Major compact a column family within a table.
|
void |
majorCompact(TableName tableName,
CompactType compactType)
Major compact 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 |
majorCompactRegionServer(ServerName serverName)
Major compact all regions on the region server.
|
void |
mergeRegions(byte[] nameOfRegionA,
byte[] nameOfRegionB,
boolean forcible)
Merge two regions.
|
Future<Void> |
mergeRegionsAsync(byte[][] nameofRegionsToMerge,
boolean forcible)
Merge multiple regions (>=2).
|
Future<Void> |
mergeRegionsAsync(byte[] nameOfRegionA,
byte[] nameOfRegionB,
boolean forcible)
Merge two regions.
|
boolean |
mergeSwitch(boolean enabled,
boolean synchronous)
Turn the merge switch on or off.
|
void |
modifyColumnFamily(TableName tableName,
ColumnFamilyDescriptor columnFamily)
Modify an existing column family on a table.
|
Future<Void> |
modifyColumnFamilyAsync(TableName tableName,
ColumnFamilyDescriptor columnFamily)
Modify an existing column family on a table.
|
Future<Void> |
modifyColumnFamilyStoreFileTrackerAsync(TableName tableName,
byte[] family,
String dstSFT)
Change the store file tracker of the given table's given family.
|
void |
modifyNamespace(NamespaceDescriptor descriptor)
Modify an existing namespace.
|
Future<Void> |
modifyNamespaceAsync(NamespaceDescriptor descriptor)
Modify an existing namespace.
|
void |
modifyTable(TableDescriptor td)
Modify an existing table, more IRB friendly version.
|
void |
modifyTable(TableName tableName,
TableDescriptor td)
Modify an existing table, more IRB friendly version.
|
Future<Void> |
modifyTableAsync(TableDescriptor td)
Modify an existing table, more IRB (ruby) friendly version.
|
Future<Void> |
modifyTableAsync(TableName tableName,
TableDescriptor td)
Modify an existing table, more IRB friendly version.
|
Future<Void> |
modifyTableStoreFileTrackerAsync(TableName tableName,
String dstSFT)
Change the store file tracker of the given table.
|
void |
move(byte[] encodedRegionName)
Move the region
encodedRegionName to a random server. |
void |
move(byte[] encodedRegionName,
ServerName destServerName)
Move the region
rencodedRegionName to destServerName . |
boolean |
normalize(NormalizeTableFilterParams ntfp)
Invoke region normalizer.
|
boolean |
normalizerSwitch(boolean on)
Turn region normalizer on or off.
|
void |
offline(byte[] regionName)
Offline specified region from master's in-memory state.
|
void |
recommissionRegionServer(ServerName server,
List<byte[]> encodedRegionNames)
Remove decommission marker from a region server to allow regions assignments.
|
Future<Void> |
removeReplicationPeerAsync(String peerId)
Remove a replication peer but does not block and wait for it.
|
void |
restoreSnapshot(byte[] snapshotName)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(String snapshotName)
Restore the specified snapshot on the original table.
|
void |
restoreSnapshot(String snapshotName,
boolean takeFailSafeSnapshot,
boolean restoreAcl)
Restore the specified snapshot on the original table.
|
Future<Void> |
restoreSnapshotAsync(String snapshotName)
Restore the specified snapshot on the original table.
|
void |
revoke(UserPermission userPermission)
Revokes user specific permissions
|
void |
rollWALWriter(ServerName serverName)
Roll the log writer.
|
int |
runCatalogJanitor()
Ask for a scan of the catalog table.
|
boolean |
runCleanerChore()
Ask for cleaner chore to run.
|
void |
setQuota(QuotaSettings quota)
Apply the new quota settings.
|
void |
shutdown()
Shuts down the HBase cluster.
|
void |
snapshot(byte[] snapshotName,
TableName tableName)
Create a timestamp consistent snapshot for the given table.
|
void |
snapshot(SnapshotDescription snapshot)
Take a snapshot and wait for the server to complete that snapshot (blocking).
|
void |
snapshot(String snapshotName,
TableName tableName)
Take a snapshot for the given table.
|
void |
snapshot(String snapshotName,
TableName tableName,
SnapshotType type)
Create typed snapshot of the table.
|
Future<Void> |
snapshotAsync(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.
|
boolean |
snapshotCleanupSwitch(boolean on,
boolean synchronous)
Turn on or off the auto snapshot cleanup based on TTL.
|
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.
|
Future<Void> |
splitRegionAsync(byte[] regionName)
Split an individual region.
|
Future<Void> |
splitRegionAsync(byte[] regionName,
byte[] splitPoint)
Split an individual region.
|
boolean |
splitSwitch(boolean enabled,
boolean synchronous)
Turn the split switch on or off.
|
void |
stopMaster()
Shuts down the current HBase master only.
|
void |
stopRegionServer(String hostnamePort)
Stop the designated regionserver.
|
boolean |
switchRpcThrottle(boolean enable)
Switch the rpc throttle enable state.
|
boolean |
tableExists(TableName tableName)
Check if a table exists.
|
void |
truncateTable(TableName tableName,
boolean preserveSplits)
Truncate a table.
|
Future<Void> |
truncateTableAsync(TableName tableName,
boolean preserveSplits)
Truncate the table but does not block and wait for it to be completely enabled.
|
void |
unassign(byte[] regionName)
Unassign a Region.
|
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.
|
Future<Void> |
updateReplicationPeerConfigAsync(String peerId,
ReplicationPeerConfig peerConfig)
Update the peerConfig for the specified peer but does not block and wait for it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addColumn, addReplicationPeer, addReplicationPeer, addReplicationPeerAsync, appendReplicationPeerTableCFs, balancer, balancer, cloneSnapshot, cloneSnapshot, cloneSnapshot, cloneSnapshot, cloneSnapshotAsync, cloneSnapshotAsync, compactRegionServer, disableReplicationPeer, enableCatalogJanitor, enableReplicationPeer, execProcedureWithRet, getBackupMasters, getClusterMetrics, getClusterStatus, getMaster, getMasterCoprocessorNames, getMasterCoprocessors, getMasterInfoPort, getRegionMetrics, getRegionServers, getRegionServers, hasUserPermissions, isSplitOrMergeEnabled, listDeadServers, listUnknownServers, modifyColumn, modifyColumnFamilyStoreFileTracker, modifyTableStoreFileTracker, move, normalize, removeReplicationPeer, removeReplicationPeerTableCFs, restoreSnapshot, restoreSnapshot, runCatalogScan, setBalancerRunning, setCleanerChoreRunning, setNormalizerRunning, setSplitOrMergeEnabled, snapshot, snapshot, takeSnapshotAsync, unassign, updateReplicationPeerConfig
private org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client
private org.apache.thrift.transport.TTransport transport
private int operationTimeout
private int syncWaitTimeout
private org.apache.hadoop.conf.Configuration conf
public ThriftAdmin(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client, org.apache.thrift.transport.TTransport tTransport, org.apache.hadoop.conf.Configuration conf)
public int getOperationTimeout()
Admin
getOperationTimeout
in interface Admin
Admin.getSyncWaitTimeout()
public int getSyncWaitTimeout()
Admin
hbase.client.sync.wait.timeout.msec
.
For several operations, such as createTable, deleteTable, etc, the rpc call will finish right
after we schedule a procedure at master side, so the timeout will not be controlled by the
above Admin.getOperationTimeout()
. And timeout value here tells you how much time we will
wait until the procedure at master side is finished.
In general, you can consider that the implementation for XXXX method is just a
XXXXAsync().get(getSyncWaitTimeout(), TimeUnit.MILLISECONDS).getSyncWaitTimeout
in interface Admin
Admin.getOperationTimeout()
public void abort(String why, Throwable e)
Abortable
public boolean isAborted()
Abortable
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Admin
IOException
public org.apache.hadoop.conf.Configuration getConfiguration()
Admin
getConfiguration
in interface Admin
public boolean tableExists(TableName tableName) throws IOException
Admin
tableExists
in interface Admin
tableName
- Table to check.true
if table exists already.IOException
- if a remote or network exception occurspublic Connection getConnection()
Admin
getConnection
in interface Admin
public HTableDescriptor[] listTables() throws IOException
Admin
listTables
in interface Admin
IOException
- if a remote or network exception occursAdmin.listTableDescriptors()
public List<TableDescriptor> listTableDescriptors() throws IOException
Admin
listTableDescriptors
in interface Admin
IOException
- if a remote or network exception occurspublic HTableDescriptor[] listTables(Pattern pattern) throws IOException
Admin
listTables
in interface Admin
pattern
- The compiled regular expression to match againstIOException
- if a remote or network exception occursAdmin.listTables()
,
Admin.listTableDescriptors(Pattern)
public List<TableDescriptor> listTableDescriptors(Pattern pattern) throws IOException
Admin
listTableDescriptors
in interface Admin
pattern
- The compiled regular expression to match againstIOException
- if a remote or network exception occursAdmin.listTables()
public HTableDescriptor[] listTables(String regex) throws IOException
Admin
listTables
in interface Admin
regex
- The regular expression to match againstIOException
- if a remote or network exception occursAdmin.listTableDescriptors(Pattern)
public HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables) throws IOException
Admin
listTables
in interface Admin
pattern
- The compiled regular expression to match againstincludeSysTables
- false
to match only against userspace tablesIOException
- if a remote or network exception occursAdmin.listTables()
,
Admin.listTableDescriptors(java.util.regex.Pattern, boolean)
public List<TableDescriptor> listTableDescriptors(Pattern pattern, boolean includeSysTables) throws IOException
Admin
listTableDescriptors
in interface Admin
pattern
- The compiled regular expression to match againstincludeSysTables
- false
to match only against userspace tablesIOException
- if a remote or network exception occursAdmin.listTables()
public HTableDescriptor[] listTables(String regex, boolean includeSysTables) throws IOException
Admin
listTables
in interface Admin
regex
- The regular expression to match againstincludeSysTables
- false
to match only against userspace tablesIOException
- if a remote or network exception occursAdmin.listTables(java.util.regex.Pattern, boolean)
public TableName[] listTableNames() throws IOException
Admin
listTableNames
in interface Admin
IOException
- if a remote or network exception occurspublic TableName[] listTableNames(Pattern pattern) throws IOException
Admin
listTableNames
in interface Admin
pattern
- The regular expression to match againstIOException
- if a remote or network exception occurspublic TableName[] listTableNames(String regex) throws IOException
Admin
listTableNames
in interface Admin
regex
- The regular expression to match againstIOException
- if a remote or network exception occurspublic TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException
Admin
listTableNames
in interface Admin
pattern
- The regular expression to match againstincludeSysTables
- false
to match only against userspace tablesIOException
- if a remote or network exception occurspublic TableName[] listTableNames(String regex, boolean includeSysTables) throws IOException
Admin
listTableNames
in interface Admin
regex
- The regular expression to match againstincludeSysTables
- false
to match only against userspace tablesIOException
- if a remote or network exception occurspublic HTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, IOException
Admin
getTableDescriptor
in interface Admin
tableName
- as a TableName
TableNotFoundException
- if the table was not foundIOException
- if a remote or network exception occurspublic TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundException, IOException
Admin
getDescriptor
in interface Admin
tableName
- as a TableName
TableNotFoundException
- if the table was not foundIOException
- if a remote or network exception occurspublic HTableDescriptor[] listTableDescriptorsByNamespace(String name) throws IOException
Admin
listTableDescriptorsByNamespace
in interface Admin
name
- namespace nameIOException
- if a remote or network exception occurspublic List<TableDescriptor> listTableDescriptorsByNamespace(byte[] name) throws IOException
Admin
listTableDescriptorsByNamespace
in interface Admin
name
- namespace nameIOException
- if a remote or network exception occurspublic TableName[] listTableNamesByNamespace(String name) throws IOException
Admin
listTableNamesByNamespace
in interface Admin
name
- namespace nameIOException
- if a remote or network exception occurspublic void createTable(TableDescriptor desc) throws IOException
Admin
createTable
in interface Admin
desc
- table descriptor for tableMasterNotRunningException
- 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).IOException
- if a remote or network exception
occurspublic void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) throws IOException
Admin
createTable
in interface Admin
desc
- table descriptor for tablestartKey
- beginning of key rangeendKey
- end of key rangenumRegions
- the total number of regions to createIOException
- if a remote or network exception
occursMasterNotRunningException
- 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).public void createTable(TableDescriptor desc, byte[][] splitKeys) throws IOException
Admin
createTable
in interface Admin
desc
- table descriptor for tablesplitKeys
- array of split keys for the initial regions of the tableMasterNotRunningException
- 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).IOException
- if a remote or network exception
occurspublic void deleteTable(TableName tableName) throws IOException
Admin
deleteTable
in interface Admin
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic void truncateTable(TableName tableName, boolean preserveSplits) throws IOException
Admin
truncateTable
in interface Admin
tableName
- name of table to truncatepreserveSplits
- true
if the splits should be preservedIOException
- if a remote or network exception occurspublic void enableTable(TableName tableName) throws IOException
Admin
Admin.enableTableAsync(org.apache.hadoop.hbase.TableName)
and Admin.isTableEnabled(org.apache.hadoop.hbase.TableName)
instead. The table has to be in
disabled state for it to be enabled.enableTable
in interface Admin
tableName
- name of the tableIOException
- 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.Admin.isTableEnabled(org.apache.hadoop.hbase.TableName)
,
Admin.disableTable(org.apache.hadoop.hbase.TableName)
,
Admin.enableTableAsync(org.apache.hadoop.hbase.TableName)
public void disableTable(TableName tableName) throws IOException
Admin
Admin.disableTableAsync(org.apache.hadoop.hbase.TableName)
and
Admin.isTableDisabled(org.apache.hadoop.hbase.TableName)
instead. The table has to be in
enabled state for it to be disabled. n * @throws IOException There could be couple types of
IOException TableNotFoundException means the table doesn't exist. TableNotEnabledException
means the table isn't in enabled state.disableTable
in interface Admin
IOException
public boolean isTableEnabled(TableName tableName) throws IOException
Admin
isTableEnabled
in interface Admin
tableName
- name of table to checktrue
if table is on-lineIOException
- if a remote or network exception occurspublic boolean isTableDisabled(TableName tableName) throws IOException
Admin
isTableDisabled
in interface Admin
tableName
- name of table to checktrue
if table is off-lineIOException
- if a remote or network exception occurspublic boolean isTableAvailable(TableName tableName) throws IOException
Admin
isTableAvailable
in interface Admin
tableName
- name of table to checktrue
if all regions of the table are availableIOException
- if a remote or network exception occurspublic boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException
Admin
false
.isTableAvailable
in interface Admin
tableName
- name of table to checksplitKeys
- keys to check if the table has been created with all split keysIOException
- if a remote or network excpetion occurspublic void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
Admin
Admin.addColumnFamilyAsync(TableName, ColumnFamilyDescriptor)
instead because it returns a
Future
from which you can learn whether success or failure.addColumnFamily
in interface Admin
tableName
- name of the table to add column family tocolumnFamily
- column family descriptor of column family to be addedIOException
- if a remote or network exception occurspublic void deleteColumn(TableName tableName, byte[] columnFamily) throws IOException
Admin
Admin.deleteColumnFamily(TableName, byte[])
instead because it returns a Future
from
which you can learn whether success or failure.deleteColumn
in interface Admin
tableName
- name of tablecolumnFamily
- name of column family to be deletedIOException
- if a remote or network exception occurspublic void deleteColumnFamily(TableName tableName, byte[] columnFamily) throws IOException
Admin
Admin.deleteColumnFamily(TableName, byte[])
instead because it returns a Future
from
which you can learn whether success or failure.deleteColumnFamily
in interface Admin
tableName
- name of tablecolumnFamily
- name of column family to be deletedIOException
- if a remote or network exception occurspublic void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
Admin
Admin.modifyColumnFamilyAsync(TableName, ColumnFamilyDescriptor)
instead because it returns
a Future
from which you can learn whether success or failure.modifyColumnFamily
in interface Admin
tableName
- name of tablecolumnFamily
- new column family descriptor to useIOException
- if a remote or network exception occurspublic void modifyTable(TableName tableName, TableDescriptor td) throws IOException
Admin
modifyTable
in interface Admin
tableName
- name of table.td
- modified description of the tableIOException
- if a remote or network exception occurspublic void modifyTable(TableDescriptor td) throws IOException
Admin
modifyTable
in interface Admin
td
- modified description of the tableIOException
- if a remote or network exception occurspublic void modifyNamespace(NamespaceDescriptor descriptor) throws IOException
Admin
modifyNamespace
in interface Admin
descriptor
- descriptor which describes the new namespaceIOException
- if a remote or network exception occurspublic void deleteNamespace(String name) throws IOException
Admin
deleteNamespace
in interface Admin
name
- namespace nameIOException
- if a remote or network exception occurspublic NamespaceDescriptor getNamespaceDescriptor(String name) throws NamespaceNotFoundException, IOException
Admin
getNamespaceDescriptor
in interface Admin
name
- name of namespace descriptorNamespaceNotFoundException
- if the namespace was not foundIOException
- if a remote or network exception
occurspublic String[] listNamespaces() throws IOException
Admin
listNamespaces
in interface Admin
IOException
- if a remote or network exception occurspublic NamespaceDescriptor[] listNamespaceDescriptors() throws IOException
Admin
listNamespaceDescriptors
in interface Admin
IOException
- if a remote or network exception occurspublic void createNamespace(NamespaceDescriptor descriptor) throws IOException
Admin
createNamespace
in interface Admin
descriptor
- descriptor which describes the new namespace.IOException
- if a remote or network exception occurspublic boolean switchRpcThrottle(boolean enable) throws IOException
Admin
switchRpcThrottle
in interface Admin
enable
- Set to true
to enable, false
to disable.IOException
- if a remote or network exception occurspublic boolean isRpcThrottleEnabled() throws IOException
Admin
isRpcThrottleEnabled
in interface Admin
IOException
- if a remote or network exception occurspublic boolean exceedThrottleQuotaSwitch(boolean enable) throws IOException
Admin
exceedThrottleQuotaSwitch
in interface Admin
enable
- Set to true
to enable, false
to disable.IOException
- if a remote or network exception occurspublic HTableDescriptor[] disableTables(String regex) throws IOException
Admin
Admin.listTableDescriptors(Pattern)
and
Admin.disableTable(org.apache.hadoop.hbase.TableName)
disableTables
in interface Admin
regex
- The regular expression to match table names againstIOException
- if a remote or network exception occursAdmin.disableTables(java.util.regex.Pattern)
,
Admin.disableTable(org.apache.hadoop.hbase.TableName)
public HTableDescriptor[] disableTables(Pattern pattern) throws IOException
Admin
Admin.listTableDescriptors(java.util.regex.Pattern)
and
Admin.disableTable(org.apache.hadoop.hbase.TableName)
disableTables
in interface Admin
pattern
- The pattern to match table names againstIOException
- if a remote or network exception occurspublic HTableDescriptor[] enableTables(String regex) throws IOException
Admin
Admin.listTableDescriptors(Pattern)
and
Admin.enableTable(org.apache.hadoop.hbase.TableName)
enableTables
in interface Admin
regex
- The regular expression to match table names againstIOException
- if a remote or network exception occursAdmin.enableTables(java.util.regex.Pattern)
,
Admin.enableTable(org.apache.hadoop.hbase.TableName)
public HTableDescriptor[] enableTables(Pattern pattern) throws IOException
Admin
Admin.listTableDescriptors(java.util.regex.Pattern)
and
Admin.enableTable(org.apache.hadoop.hbase.TableName)
enableTables
in interface Admin
pattern
- The pattern to match table names againstIOException
- if a remote or network exception occurspublic HTableDescriptor[] deleteTables(String regex) throws IOException
Admin
Admin.listTableDescriptors(Pattern)
and
Admin.deleteTable(org.apache.hadoop.hbase.TableName)
deleteTables
in interface Admin
regex
- The regular expression to match table names againstIOException
- if a remote or network exception occursAdmin.deleteTables(java.util.regex.Pattern)
,
Admin.deleteTable(org.apache.hadoop.hbase.TableName)
public HTableDescriptor[] deleteTables(Pattern pattern) throws IOException
Admin
Admin.listTableDescriptors(java.util.regex.Pattern)
and
Admin.deleteTable(org.apache.hadoop.hbase.TableName)
deleteTables
in interface Admin
pattern
- The pattern to match table names againstIOException
- if a remote or network exception occurspublic HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames) throws IOException
Admin
getTableDescriptorsByTableName
in interface Admin
tableNames
- List of table namesIOException
- if a remote or network exception occurspublic List<TableDescriptor> listTableDescriptors(List<TableName> tableNames) throws IOException
Admin
listTableDescriptors
in interface Admin
tableNames
- List of table namesIOException
- if a remote or network exception occurspublic HTableDescriptor[] getTableDescriptors(List<String> names) throws IOException
Admin
getTableDescriptors
in interface Admin
names
- List of table namesIOException
- if a remote or network exception occurspublic void closeRegion(String regionname, String serverName)
Admin
Admin.unassign(byte[], boolean)
to unassign the region. For expert-admins.closeRegion
in interface Admin
regionname
- region name to closeserverName
- Deprecated. Not used.public void closeRegion(byte[] regionname, String serverName)
Admin
Admin.unassign(byte[], boolean)
to unassign the region. For expert-admins.closeRegion
in interface Admin
regionname
- region name to closeserverName
- Deprecated. Not used.public boolean closeRegionWithEncodedRegionName(String encodedRegionName, String serverName)
Admin
Admin.unassign(byte[], boolean)
to unassign the region. For expert-admins.closeRegionWithEncodedRegionName
in interface Admin
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
- Deprecated. Not used.true
always.public void closeRegion(ServerName sn, HRegionInfo hri)
Admin
Admin.unassign(byte[], boolean)
to unassign the region. For expert-admins.closeRegion
in interface Admin
sn
- Deprecated. Not used.public List<HRegionInfo> getOnlineRegions(ServerName sn)
Admin
getOnlineRegions
in interface Admin
public List<RegionInfo> getRegions(ServerName serverName)
Admin
getRegions
in interface Admin
RegionInfo
public void flush(TableName tableName)
Admin
public void flush(TableName tableName, byte[] columnFamily)
Admin
public void flushRegion(byte[] regionName)
Admin
flushRegion
in interface Admin
regionName
- region to flushpublic void flushRegion(byte[] regionName, byte[] columnFamily)
Admin
flushRegion
in interface Admin
regionName
- region to flushcolumnFamily
- column family within a regionpublic void flushRegionServer(ServerName serverName)
Admin
flushRegionServer
in interface Admin
serverName
- the region server name to flushpublic void compact(TableName tableName)
Admin
public void compactRegion(byte[] regionName)
Admin
compactRegion
in interface Admin
regionName
- region to compactpublic void compact(TableName tableName, byte[] columnFamily)
Admin
public void compactRegion(byte[] regionName, byte[] columnFamily)
Admin
compactRegion
in interface Admin
regionName
- region to compactcolumnFamily
- column family within a regionpublic void compact(TableName tableName, CompactType compactType)
Admin
compact
in interface Admin
tableName
- table to compactcompactType
- CompactType
public void compact(TableName tableName, byte[] columnFamily, CompactType compactType)
Admin
compact
in interface Admin
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
- CompactType
public void majorCompact(TableName tableName)
Admin
majorCompact
in interface Admin
tableName
- table to major compactpublic void majorCompactRegion(byte[] regionName)
Admin
majorCompactRegion
in interface Admin
regionName
- region to major compactpublic void majorCompact(TableName tableName, byte[] columnFamily)
Admin
majorCompact
in interface Admin
tableName
- table to major compactcolumnFamily
- column family within a tablepublic void majorCompactRegion(byte[] regionName, byte[] columnFamily)
Admin
majorCompactRegion
in interface Admin
regionName
- egion to major compactcolumnFamily
- column family within a regionpublic void majorCompact(TableName tableName, CompactType compactType)
Admin
majorCompact
in interface Admin
tableName
- table to compactcompactType
- CompactType
public void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType)
Admin
majorCompact
in interface Admin
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
- CompactType
public Map<ServerName,Boolean> compactionSwitch(boolean switchState, List<String> serverNamesList)
Admin
compactionSwitch
in interface Admin
switchState
- Set to true
to enable, false
to disable.serverNamesList
- list of region servers.public void compactRegionServer(ServerName serverName)
Admin
compactRegionServer
in interface Admin
serverName
- the region server namepublic void majorCompactRegionServer(ServerName serverName)
Admin
majorCompactRegionServer
in interface Admin
serverName
- the region server namepublic void move(byte[] encodedRegionName)
Admin
encodedRegionName
to a random server.move
in interface Admin
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
.public void move(byte[] encodedRegionName, ServerName destServerName)
Admin
rencodedRegionName
to destServerName
.move
in interface Admin
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. A server name is made
of host, port and startcode. Here is an example:
host187.example.com,60020,1289493121758
public void assign(byte[] regionName)
Admin
public void unassign(byte[] regionName)
Admin
public void offline(byte[] regionName)
Admin
public boolean balancerSwitch(boolean onOrOff, boolean synchronous)
Admin
balancerSwitch
in interface Admin
onOrOff
- Set to true
to enable, false
to disable.synchronous
- If true
, it waits until current balance() call, if outstanding,
to return.public boolean balance()
Admin
public boolean balance(boolean force)
Admin
public BalanceResponse balance(BalanceRequest request) throws IOException
Admin
BalanceRequest
for more details.balance
in interface Admin
request
- defines how the balancer should runBalanceResponse
with details about the results of the invocation.IOException
- if a remote or network exception occurspublic boolean isBalancerEnabled()
Admin
isBalancerEnabled
in interface Admin
true
if the balancer is enabled, false
otherwise.public CacheEvictionStats clearBlockCache(TableName tableName)
Admin
clearBlockCache
in interface Admin
tableName
- table to clear block cachepublic boolean normalize(NormalizeTableFilterParams ntfp)
Admin
public boolean isNormalizerEnabled()
Admin
isNormalizerEnabled
in interface Admin
true
if region normalizer is enabled, false
otherwise.public boolean normalizerSwitch(boolean on)
Admin
normalizerSwitch
in interface Admin
public boolean catalogJanitorSwitch(boolean onOrOff)
Admin
catalogJanitorSwitch
in interface Admin
onOrOff
- if true
enables the catalog janitorpublic int runCatalogJanitor()
Admin
runCatalogJanitor
in interface Admin
public boolean isCatalogJanitorEnabled()
Admin
isCatalogJanitorEnabled
in interface Admin
public boolean cleanerChoreSwitch(boolean onOrOff)
Admin
cleanerChoreSwitch
in interface Admin
onOrOff
- if true
enables the cleaner chorepublic boolean runCleanerChore()
Admin
runCleanerChore
in interface Admin
true
if cleaner chore ran, false
otherwisepublic boolean isCleanerChoreEnabled()
Admin
isCleanerChoreEnabled
in interface Admin
public void mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible)
Admin
mergeRegions
in interface Admin
nameOfRegionA
- encoded or full name of region anameOfRegionB
- encoded or full name of region bforcible
- true
if do a compulsory merge, otherwise we will only merge
two adjacent regionspublic Future<Void> mergeRegionsAsync(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible)
Admin
mergeRegionsAsync
in interface Admin
nameOfRegionA
- encoded or full name of region anameOfRegionB
- encoded or full name of region bforcible
- true
if do a compulsory merge, otherwise we will only merge
two adjacent regionspublic Future<Void> mergeRegionsAsync(byte[][] nameofRegionsToMerge, boolean forcible)
Admin
mergeRegionsAsync
in interface Admin
nameofRegionsToMerge
- encoded or full name of daughter regionsforcible
- true
if do a compulsory merge, otherwise we will only
merge adjacent regionspublic void split(TableName tableName)
Admin
public void splitRegion(byte[] regionName)
Admin
splitRegion
in interface Admin
regionName
- region to splitpublic void split(TableName tableName, byte[] splitPoint)
Admin
public void splitRegion(byte[] regionName, byte[] splitPoint)
Admin
splitRegion
in interface Admin
regionName
- region to splitsplitPoint
- the explicit position to split onpublic Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint)
Admin
splitRegionAsync
in interface Admin
regionName
- region to splitsplitPoint
- the explicit position to split onpublic Future<Void> modifyTableAsync(TableName tableName, TableDescriptor td)
Admin
modifyTableAsync
in interface Admin
tableName
- name of table.td
- modified description of the tablepublic Future<Void> modifyTableAsync(TableDescriptor td)
Admin
modifyTableAsync
in interface Admin
td
- description of the tablepublic void shutdown()
Admin
public void stopMaster()
Admin
stopMaster
in interface Admin
Admin.shutdown()
public boolean isMasterInMaintenanceMode()
Admin
isMasterInMaintenanceMode
in interface Admin
public void stopRegionServer(String hostnamePort)
Admin
stopRegionServer
in interface Admin
hostnamePort
- Hostname and port delimited by a :
as in
example.org:1234
public ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options)
Admin
ClusterMetrics.Option
to get desired status.getClusterMetrics
in interface Admin
public List<RegionMetrics> getRegionMetrics(ServerName serverName, TableName tableName)
Admin
RegionMetrics
of all regions hosted on a regionserver for a table.getRegionMetrics
in interface Admin
serverName
- region server from which RegionMetrics
is required.tableName
- get RegionMetrics
of regions belonging to the tablepublic Future<Void> createNamespaceAsync(NamespaceDescriptor descriptor)
Admin
createNamespaceAsync
in interface Admin
descriptor
- descriptor which describes the new namespacepublic Future<Void> modifyNamespaceAsync(NamespaceDescriptor descriptor)
Admin
modifyNamespaceAsync
in interface Admin
descriptor
- descriptor which describes the new namespacepublic List<HRegionInfo> getTableRegions(TableName tableName)
Admin
getTableRegions
in interface Admin
tableName
- the name of the tableHRegionInfo
.public List<RegionInfo> getRegions(TableName tableName)
Admin
getRegions
in interface Admin
tableName
- the name of the tableRegionInfo
.public boolean abortProcedure(long procId, boolean mayInterruptIfRunning)
Admin
abortProcedure
in interface Admin
procId
- ID of the procedure to abortmayInterruptIfRunning
- if the proc completed at least one step, should it be aborted?true
if aborted, false
if procedure already completed or does
not existpublic Future<Boolean> abortProcedureAsync(long procId, boolean mayInterruptIfRunning)
Admin
abortProcedureAsync
in interface Admin
procId
- ID of the procedure to abortmayInterruptIfRunning
- if the proc completed at least one step, should it be aborted?true
if aborted, false
if procedure already completed or does
not existpublic String getProcedures()
Admin
getProcedures
in interface Admin
public void rollWALWriter(ServerName serverName)
Admin
rollWALWriter
in interface Admin
serverName
- The servername of the regionserver.public CompactionState getCompactionState(TableName tableName)
Admin
getCompactionState
in interface Admin
tableName
- table to examinepublic CompactionState getCompactionState(TableName tableName, CompactType compactType)
Admin
getCompactionState
in interface Admin
tableName
- table to examinecompactType
- CompactType
public CompactionState getCompactionStateForRegion(byte[] regionName)
Admin
getCompactionStateForRegion
in interface Admin
regionName
- region to examinepublic long getLastMajorCompactionTimestamp(TableName tableName)
Admin
getLastMajorCompactionTimestamp
in interface Admin
tableName
- table to examinepublic long getLastMajorCompactionTimestampForRegion(byte[] regionName)
Admin
getLastMajorCompactionTimestampForRegion
in interface Admin
regionName
- region to examinepublic void snapshot(String snapshotName, TableName tableName)
Admin
SnapshotCreationException
indicating the duplicate
naming. Snapshot names follow the same naming constraints as tables in HBase. See
TableName.isLegalFullyQualifiedTableName(byte[])
.public void snapshot(byte[] snapshotName, TableName tableName)
Admin
SnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in
HBase.public void snapshot(String snapshotName, TableName tableName, SnapshotType type)
Admin
SnapshotCreationException
indicating the
duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. See
TableName.isLegalFullyQualifiedTableName(byte[])
.public void snapshot(SnapshotDescription snapshot)
Admin
SnapshotCreationException
indicating the duplicate naming. Snapshot names follow the
same naming constraints as tables in HBase. See
TableName.isLegalFullyQualifiedTableName(byte[])
. You should
probably use Admin.snapshot(String, org.apache.hadoop.hbase.TableName)
or
Admin.snapshot(byte[], org.apache.hadoop.hbase.TableName)
unless you are sure about the type
of snapshot that you want to take.public Future<Void> snapshotAsync(SnapshotDescription snapshot)
Admin
snapshotAsync
in interface Admin
snapshot
- snapshot to takepublic boolean isSnapshotFinished(SnapshotDescription snapshot)
Admin
UnknownSnapshotException
.isSnapshotFinished
in interface Admin
snapshot
- description of the snapshot to checkpublic void restoreSnapshot(byte[] snapshotName)
Admin
true
, a snapshot of the current table is taken before executing the restore
operation. In case of restore failure, the failsafe snapshot will be restored. If the restore
completes without problem the failsafe snapshot is deleted.restoreSnapshot
in interface Admin
snapshotName
- name of the snapshot to restorepublic void restoreSnapshot(String snapshotName)
Admin
true
, a snapshot of the current table is taken before executing the restore
operation. In case of restore failure, the failsafe snapshot will be restored. If the restore
completes without problem the failsafe snapshot is deleted.restoreSnapshot
in interface Admin
snapshotName
- name of the snapshot to restorepublic Future<Void> restoreSnapshotAsync(String snapshotName)
Admin
true
, a snapshot of the current table is taken before executing the restore
operation. In case of restore failure, the failsafe snapshot will be restored. If the restore
completes without problem the failsafe snapshot is deleted.restoreSnapshotAsync
in interface Admin
snapshotName
- name of the snapshot to restorepublic void restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot, boolean restoreAcl)
Admin
true
, a snapshot of the current table is taken
before executing the restore operation. In case of restore failure, the failsafe snapshot will
be restored. If the restore completes without problem the failsafe snapshot is deleted. The
failsafe snapshot name is configurable by using the property
"hbase.snapshot.restore.failsafe.name".restoreSnapshot
in interface Admin
snapshotName
- name of the snapshot to restoretakeFailSafeSnapshot
- true
if the failsafe snapshot should be takenrestoreAcl
- true
to restore acl of snapshotpublic Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean cloneAcl, String customSFT) throws IOException, TableExistsException, RestoreSnapshotException
Admin
cloneSnapshotAsync
in interface Admin
snapshotName
- name of the snapshot to be clonedtableName
- name of the table where the snapshot will be restoredcloneAcl
- true
to clone acl into newly created tablecustomSFT
- specify the StroreFileTracker used for the tableIOException
- if a remote or network exception occursTableExistsException
- if table to be created already existsRestoreSnapshotException
- if snapshot failed to be clonedpublic void execProcedure(String signature, String instance, Map<String,String> props)
Admin
execProcedure
in interface Admin
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 procedurepublic byte[] execProcedureWithReturn(String signature, String instance, Map<String,String> props)
Admin
execProcedureWithReturn
in interface Admin
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 procedurepublic boolean isProcedureFinished(String signature, String instance, Map<String,String> props)
Admin
isProcedureFinished
in interface Admin
signature
- The signature that uniquely identifies a procedureinstance
- The instance name of the procedureprops
- Property/Value pairs of properties passing to the proceduretrue
if the specified procedure is finished successfully,
false
if it is still runningpublic List<SnapshotDescription> listSnapshots()
Admin
listSnapshots
in interface Admin
public List<SnapshotDescription> listSnapshots(String regex)
Admin
listSnapshots
in interface Admin
regex
- The regular expression to match againstpublic List<SnapshotDescription> listSnapshots(Pattern pattern)
Admin
listSnapshots
in interface Admin
pattern
- The compiled regular expression to match againstpublic List<SnapshotDescription> listTableSnapshots(String tableNameRegex, String snapshotNameRegex)
Admin
listTableSnapshots
in interface Admin
tableNameRegex
- The table name regular expression to match againstsnapshotNameRegex
- The snapshot name regular expression to match againstpublic List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern)
Admin
listTableSnapshots
in interface Admin
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match againstpublic void deleteSnapshot(byte[] snapshotName)
Admin
deleteSnapshot
in interface Admin
snapshotName
- name of the snapshotpublic void deleteSnapshot(String snapshotName)
Admin
deleteSnapshot
in interface Admin
snapshotName
- name of the snapshotpublic void deleteSnapshots(String regex)
Admin
deleteSnapshots
in interface Admin
regex
- The regular expression to match againstpublic void deleteSnapshots(Pattern pattern)
Admin
deleteSnapshots
in interface Admin
pattern
- pattern for names of the snapshot to matchpublic void deleteTableSnapshots(String tableNameRegex, String snapshotNameRegex)
Admin
deleteTableSnapshots
in interface Admin
tableNameRegex
- The table name regular expression to match againstsnapshotNameRegex
- The snapshot name regular expression to match againstpublic void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern)
Admin
deleteTableSnapshots
in interface Admin
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match againstpublic void setQuota(QuotaSettings quota)
Admin
public QuotaRetriever getQuotaRetriever(QuotaFilter filter)
Admin
getQuotaRetriever
in interface Admin
filter
- the quota settings filterpublic List<QuotaSettings> getQuota(QuotaFilter filter)
Admin
public CoprocessorRpcChannel coprocessorService()
Admin
RpcChannel
instance connected to the active
master.
The obtained RpcChannel
instance can be used to access a published
coprocessor 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);
coprocessorService
in interface Admin
public CoprocessorRpcChannel coprocessorService(ServerName serverName)
Admin
RpcChannel
instance connected to the passed
region server.
The obtained RpcChannel
instance can be used to access a published
coprocessor 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);
coprocessorService
in interface Admin
serverName
- the server name to which the endpoint call is madepublic void updateConfiguration(ServerName server)
Admin
updateConfiguration
in interface Admin
server
- : The server whose config needs to be updated.public void updateConfiguration()
Admin
updateConfiguration
in interface Admin
public List<SecurityCapability> getSecurityCapabilities()
Admin
getSecurityCapabilities
in interface Admin
public boolean splitSwitch(boolean enabled, boolean synchronous)
Admin
splitSwitch
in interface Admin
enabled
- enabled or notsynchronous
- If true
, it waits until current split() call, if outstanding,
to return.public boolean mergeSwitch(boolean enabled, boolean synchronous)
Admin
mergeSwitch
in interface Admin
enabled
- enabled or notsynchronous
- If true
, it waits until current merge() call, if outstanding,
to return.public boolean isSplitEnabled()
Admin
isSplitEnabled
in interface Admin
true
if the switch is enabled, false
otherwise.public boolean isMergeEnabled()
Admin
isMergeEnabled
in interface Admin
true
if the switch is enabled, false
otherwise.public Future<Void> addReplicationPeerAsync(String peerId, ReplicationPeerConfig peerConfig, boolean enabled)
Admin
You can use Future.get(long, TimeUnit) to wait on the operation to complete. It may throw ExecutionException if there was an error while executing the operation or TimeoutException in case the wait timeout was not long enough to allow the operation to complete.
addReplicationPeerAsync
in interface Admin
peerId
- a short name that identifies the peerpeerConfig
- configuration for the replication peerenabled
- peer state, true if ENABLED and false if DISABLEDpublic Future<Void> removeReplicationPeerAsync(String peerId)
Admin
You can use Future.get(long, TimeUnit) to wait on the operation to complete. It may throw ExecutionException if there was an error while executing the operation or TimeoutException in case the wait timeout was not long enough to allow the operation to complete.
removeReplicationPeerAsync
in interface Admin
peerId
- a short name that identifies the peerpublic Future<Void> enableReplicationPeerAsync(String peerId)
Admin
You can use Future.get(long, TimeUnit) to wait on the operation to complete. It may throw ExecutionException if there was an error while executing the operation or TimeoutException in case the wait timeout was not long enough to allow the operation to complete.
enableReplicationPeerAsync
in interface Admin
peerId
- a short name that identifies the peerpublic Future<Void> disableReplicationPeerAsync(String peerId)
Admin
disableReplicationPeerAsync
in interface Admin
peerId
- a short name that identifies the peerpublic ReplicationPeerConfig getReplicationPeerConfig(String peerId)
Admin
getReplicationPeerConfig
in interface Admin
peerId
- a short name that identifies the peerpublic Future<Void> updateReplicationPeerConfigAsync(String peerId, ReplicationPeerConfig peerConfig)
Admin
updateReplicationPeerConfigAsync
in interface Admin
peerId
- a short name that identifies the peerpeerConfig
- new config for the replication peerpublic List<ReplicationPeerDescription> listReplicationPeers()
Admin
listReplicationPeers
in interface Admin
public List<ReplicationPeerDescription> listReplicationPeers(Pattern pattern)
Admin
listReplicationPeers
in interface Admin
pattern
- The compiled regular expression to match peer idpublic void decommissionRegionServers(List<ServerName> servers, boolean offload)
Admin
decommissionRegionServers
in interface Admin
servers
- The list of servers to decommission.offload
- True to offload the regions from the decommissioned serverspublic List<ServerName> listDecommissionedRegionServers()
Admin
listDecommissionedRegionServers
in interface Admin
public void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames)
Admin
recommissionRegionServer
in interface Admin
server
- The server to recommission.encodedRegionNames
- Regions to load onto the server.public List<TableCFs> listReplicatedTableCFs()
Admin
listReplicatedTableCFs
in interface Admin
public void enableTableReplication(TableName tableName)
Admin
enableTableReplication
in interface Admin
tableName
- name of the tablepublic void disableTableReplication(TableName tableName)
Admin
disableTableReplication
in interface Admin
tableName
- name of the tablepublic void clearCompactionQueues(ServerName serverName, Set<String> queues)
Admin
clearCompactionQueues
in interface Admin
serverName
- the region server namequeues
- the set of queue namepublic List<ServerName> clearDeadServers(List<ServerName> servers)
Admin
clearDeadServers
in interface Admin
servers
- list of dead region servers.public void cloneTableSchema(TableName tableName, TableName newTableName, boolean preserveSplits)
Admin
cloneTableSchema
in interface Admin
tableName
- name of the table to be clonednewTableName
- name of the new table where the table will be createdpreserveSplits
- True if the splits should be preservedpublic Future<Void> createTableAsync(TableDescriptor desc)
Admin
createTableAsync
in interface Admin
desc
- table descriptor for tablepublic Future<Void> createTableAsync(TableDescriptor desc, byte[][] splitKeys)
Admin
createTableAsync
in interface Admin
desc
- table descriptor for tablesplitKeys
- keys to check if the table has been created with all split keyspublic Future<Void> deleteTableAsync(TableName tableName)
Admin
deleteTableAsync
in interface Admin
tableName
- name of table to deletepublic Future<Void> truncateTableAsync(TableName tableName, boolean preserveSplits)
Admin
truncateTableAsync
in interface Admin
tableName
- name of table to deletepreserveSplits
- true
if the splits should be preservedpublic Future<Void> enableTableAsync(TableName tableName)
Admin
enableTableAsync
in interface Admin
tableName
- name of table to deletepublic Future<Void> disableTableAsync(TableName tableName)
Admin
disableTableAsync
in interface Admin
tableName
- name of table to deletepublic Pair<Integer,Integer> getAlterStatus(TableName tableName)
Admin
alter
(a.k.a modify
) command - indicates how
many regions have received the updated schema Asynchronous operation.getAlterStatus
in interface Admin
tableName
- TableName instancepublic Pair<Integer,Integer> getAlterStatus(byte[] tableName)
Admin
alter
(a.k.a modify
) command - indicates how many
regions have received the updated schema Asynchronous operation.getAlterStatus
in interface Admin
tableName
- name of the table to get the status ofpublic Future<Void> deleteColumnFamilyAsync(TableName tableName, byte[] columnFamily)
Admin
deleteColumnFamilyAsync
in interface Admin
tableName
- name of tablecolumnFamily
- name of column family to be deletedpublic Future<Void> addColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily)
Admin
addColumnFamilyAsync
in interface Admin
tableName
- name of the table to add column family tocolumnFamily
- column family descriptor of column family to be addedpublic Future<Void> modifyColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily)
Admin
modifyColumnFamilyAsync
in interface Admin
tableName
- name of tablecolumnFamily
- new column family descriptor to usepublic Future<Void> deleteNamespaceAsync(String name)
Admin
deleteNamespaceAsync
in interface Admin
name
- namespace namepublic Map<TableName,Long> getSpaceQuotaTableSizes() throws IOException
Admin
getSpaceQuotaTableSizes
in interface Admin
IOException
- if a remote or network exception occurspublic Map<TableName,SpaceQuotaSnapshot> getRegionServerSpaceQuotaSnapshots(ServerName serverName) throws IOException
Admin
SpaceQuotaSnapshotView
s observed by a RegionServer.getRegionServerSpaceQuotaSnapshots
in interface Admin
IOException
- if a remote or network exception occurspublic SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(String namespace) throws IOException
Admin
namespace
or null if the Master has
no quota information on that namespace.getCurrentSpaceQuotaSnapshot
in interface Admin
IOException
- if a remote or network exception occurspublic SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(TableName tableName) throws IOException
Admin
tableName
or null if the Master has
no quota information on that table.getCurrentSpaceQuotaSnapshot
in interface Admin
IOException
- if a remote or network exception occurspublic void grant(UserPermission userPermission, boolean mergeExistingPermissions)
Admin
public void revoke(UserPermission userPermission)
Admin
public List<UserPermission> getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest)
Admin
getUserPermissions
in interface Admin
getUserPermissionsRequest
- A request contains which user, global, namespace or table
permissions neededpublic List<Boolean> hasUserPermissions(String userName, List<Permission> permissions)
Admin
hasUserPermissions
in interface Admin
userName
- the user namepermissions
- the specific permission listpublic boolean snapshotCleanupSwitch(boolean on, boolean synchronous)
Admin
snapshotCleanupSwitch
in interface Admin
on
- Set to true
to enable, false
to disable.synchronous
- If true
, it waits until current snapshot cleanup is completed,
if outstanding.public boolean isSnapshotCleanupEnabled()
Admin
isSnapshotCleanupEnabled
in interface Admin
true
if the auto snapshot cleanup is enabled, false
otherwise.public List<OnlineLogRecord> getSlowLogResponses(Set<ServerName> serverNames, LogQueryFilter logQueryFilter) throws IOException
Admin
getSlowLogResponses
in interface Admin
serverNames
- Server names to get slowlog responses fromlogQueryFilter
- filter to be used if provided (determines slow / large RPC logs)IOException
- if a remote or network exception occurspublic List<Boolean> clearSlowLogResponses(Set<ServerName> serverNames) throws IOException
Admin
clearSlowLogResponses
in interface Admin
serverNames
- Set of Server names to clean slowlog responses fromIOException
- if a remote or network exception occurspublic Future<Void> splitRegionAsync(byte[] regionName) throws IOException
Admin
splitRegionAsync
in interface Admin
regionName
- region to splitIOException
- if a remote or network exception occurspublic List<LogEntry> getLogEntries(Set<ServerName> serverNames, String logType, ServerType serverType, int limit, Map<String,Object> filterParams) throws IOException
Admin
getLogEntries
in interface Admin
serverNames
- servers to retrieve records from, useful in case of records maintained by
RegionServer as we can select specific server. In case of
servertype=MASTER, logs will only come from the currently active master.logType
- string representing type of log recordsserverType
- enum for server type: HMaster or RegionServerlimit
- put a limit to list of records that server should send in responsefilterParams
- additional filter paramsIOException
- if a remote or network exception occurspublic void flushMasterStore() throws IOException
Admin
flushMasterStore
in interface Admin
IOException
public Future<Void> modifyColumnFamilyStoreFileTrackerAsync(TableName tableName, byte[] family, String dstSFT) throws IOException
Admin
modifyColumnFamilyStoreFileTrackerAsync
in interface Admin
tableName
- the table you want to changefamily
- the family you want to changedstSFT
- the destination store file trackerIOException
- if a remote or network exception occurspublic Future<Void> modifyTableStoreFileTrackerAsync(TableName tableName, String dstSFT) throws IOException
Admin
modifyTableStoreFileTrackerAsync
in interface Admin
tableName
- the table you want to changedstSFT
- the destination store file trackerIOException
- if a remote or network exception occursCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.