@InterfaceAudience.Private class AdminOverAsyncAdmin extends Object implements Admin
Admin
implementation which is based on an AsyncAdmin
.Modifier and Type | Class and Description |
---|---|
private static class |
AdminOverAsyncAdmin.SyncCoprocessorRpcChannelOverAsync |
Modifier and Type | Field and Description |
---|---|
private boolean |
aborted |
private RawAsyncHBaseAdmin |
admin |
private Connection |
conn |
private static org.slf4j.Logger |
LOG |
private int |
operationTimeout |
private int |
syncWaitTimeout |
Constructor and Description |
---|
AdminOverAsyncAdmin(Connection conn,
RawAsyncHBaseAdmin admin) |
Modifier and Type | Method and Description |
---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
Future<Boolean> |
abortProcedureAsync(long procId,
boolean mayInterruptIfRunning)
Abort a procedure but does not block and wait for completion.
|
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 |
addRSGroup(String groupName)
Creates a new RegionServer group with the given name
|
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.
|
BalanceResponse |
balanceRSGroup(String groupName,
BalanceRequest request)
Balance regions in the given RegionServer group, running based on the given
BalanceRequest . |
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 restoreAcl,
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 |
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. |
Future<Void> |
createNamespaceAsync(NamespaceDescriptor descriptor)
Create a new namespace.
|
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.
|
Future<Void> |
deleteColumnFamilyAsync(TableName tableName,
byte[] columnFamily)
Delete a column family from a table.
|
Future<Void> |
deleteNamespaceAsync(String name)
Delete an existing namespace.
|
void |
deleteSnapshot(String snapshotName)
Delete an existing snapshot.
|
void |
deleteSnapshots(Pattern pattern)
Delete existing snapshots whose names match the pattern passed.
|
Future<Void> |
deleteTableAsync(TableName tableName)
Deletes the table but does not block and wait for it to be completely removed.
|
void |
deleteTableSnapshots(Pattern tableNamePattern,
Pattern snapshotNamePattern)
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.
|
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.
|
Future<Void> |
enableReplicationPeerAsync(String peerId)
Enable a replication peer but does not block and wait for it.
|
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.
|
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 |
flush(TableName tableName,
List<byte[]> columnFamilies)
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.
|
List<String> |
getCachedFilesList(ServerName serverName)
Get the list of cached files
|
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.
|
Pair<List<String>,List<TableName>> |
getConfiguredNamespacesAndTablesInRSGroup(String groupName)
Get the namespaces and tables which have this RegionServer group in descriptor.
|
Connection |
getConnection()
Returns Connection used by this object.
|
SpaceQuotaSnapshotView |
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. |
SpaceQuotaSnapshotView |
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.
|
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.
|
List<RegionMetrics> |
getRegionMetrics(ServerName serverName)
Get
RegionMetrics of all regions hosted on a regionserver. |
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,? extends SpaceQuotaSnapshotView> |
getRegionServerSpaceQuotaSnapshots(ServerName serverName)
Fetches the observed
SpaceQuotaSnapshotView s observed by a RegionServer. |
ReplicationPeerConfig |
getReplicationPeerConfig(String peerId)
Returns the configured ReplicationPeerConfig for the specified peer.
|
RSGroupInfo |
getRSGroup(Address hostPort)
Get group info for the given hostPort
|
RSGroupInfo |
getRSGroup(String groupName)
Get group info for the given group name
|
RSGroupInfo |
getRSGroup(TableName tableName)
Get group info for the given table
|
List<SecurityCapability> |
getSecurityCapabilities()
Return the set of supported security capabilities.
|
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.
|
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 |
isReplicationPeerEnabled(String peerId)
Check if a replication peer is enabled.
|
boolean |
isReplicationPeerModificationEnabled()
Check whether replication peer modification is enabled.
|
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 |
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<RSGroupInfo> |
listRSGroups()
Lists current set of RegionServer groups
|
List<SnapshotDescription> |
listSnapshots()
List completed snapshots.
|
List<SnapshotDescription> |
listSnapshots(Pattern pattern)
List all the completed snapshots matching the given pattern.
|
List<TableDescriptor> |
listTableDescriptors()
List all the userspace tables.
|
List<TableDescriptor> |
listTableDescriptors(boolean includeSysTables)
List all userspace tables and whether or not include system tables.
|
List<TableDescriptor> |
listTableDescriptors(List<TableName> tableNames)
Get tableDescriptors.
|
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.
|
List<TableDescriptor> |
listTableDescriptorsByState(boolean isEnabled)
List all enabled or disabled tables
|
TableName[] |
listTableNames()
List all of the names of userspace tables.
|
TableName[] |
listTableNames(Pattern pattern,
boolean includeSysTables)
List all of the names of userspace tables.
|
TableName[] |
listTableNamesByNamespace(String name)
Get list of table names by namespace.
|
List<TableName> |
listTableNamesByState(boolean isEnabled)
List all enabled or disabled table names
|
List<TableName> |
listTablesInRSGroup(String groupName)
Get all tables in this RegionServer group.
|
List<SnapshotDescription> |
listTableSnapshots(Pattern tableNamePattern,
Pattern snapshotNamePattern)
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.
|
Future<Void> |
mergeRegionsAsync(byte[][] nameOfRegionsToMerge,
boolean forcible)
Merge multiple regions (>=2).
|
boolean |
mergeSwitch(boolean enabled,
boolean synchronous)
Turn the merge switch on or off.
|
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.
|
Future<Void> |
modifyNamespaceAsync(NamespaceDescriptor descriptor)
Modify an existing namespace.
|
Future<Void> |
modifyTableAsync(TableDescriptor td)
Modify an existing table, more IRB (ruby) friendly version.
|
Future<Void> |
modifyTableAsync(TableDescriptor td,
boolean reopenRegions)
The same as
Admin.modifyTableAsync(TableDescriptor td) , except for the reopenRegions
parameter, which controls whether the process of modifying the table should reopen all regions. |
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
encodedRegionName to destServerName . |
void |
moveServersToRSGroup(Set<Address> servers,
String groupName)
Move given set of servers to the specified target RegionServer group
|
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 |
removeRSGroup(String groupName)
Remove RegionServer group associated with the given name
|
void |
removeServersFromRSGroup(Set<Address> servers)
Remove decommissioned servers from group 1.
|
void |
renameRSGroup(String oldName,
String newName)
Rename rsgroup
|
boolean |
replicationPeerModificationSwitch(boolean on,
boolean drainProcedures)
Enable or disable replication peer modification.
|
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.
|
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 |
setRSGroup(Set<TableName> tables,
String groupName)
Set the RegionServer group for tables
|
void |
shutdown()
Shuts down the HBase cluster.
|
void |
snapshot(SnapshotDescription snapshot)
Take a snapshot and wait for the server to complete that snapshot (blocking).
|
Future<Void> |
snapshotAsync(SnapshotDescription snapshot)
Take a snapshot without waiting for the server to complete that snapshot (asynchronous).
|
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.
|
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.
|
Future<Void> |
transitReplicationPeerSyncReplicationStateAsync(String peerId,
SyncReplicationState state)
Transit current cluster to a new state in a synchronous replication peer.
|
void |
truncateRegion(byte[] regionName)
Truncate an individual region.
|
Future<Void> |
truncateRegionAsync(byte[] regionName)
Truncate an individual region.
|
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.
|
void |
updateConfiguration(String groupName)
Update the configuration and trigger an online config change on all the regionservers in the
RSGroup.
|
Future<Void> |
updateReplicationPeerConfigAsync(String peerId,
ReplicationPeerConfig peerConfig)
Update the peerConfig for the specified peer but does not block and wait for it.
|
void |
updateRSGroupConfig(String groupName,
Map<String,String> configuration)
Update RSGroup configuration
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abortProcedure, addColumnFamily, addReplicationPeer, addReplicationPeer, addReplicationPeerAsync, appendReplicationPeerTableCFs, balanceRSGroup, cloneSnapshot, cloneSnapshot, cloneSnapshot, cloneSnapshotAsync, cloneSnapshotAsync, createNamespace, createTable, createTable, deleteColumnFamily, deleteNamespace, deleteTable, disableReplicationPeer, disableTable, enableReplicationPeer, enableTable, getBackupMasters, getClusterMetrics, getMaster, getMasterCoprocessorNames, getMasterInfoPort, getRegionServers, getRegionServers, getReplicationPeerSyncReplicationState, getSlowLogResponses, hasUserPermissions, listDeadServers, listTableDescriptors, listTableNames, listUnknownServers, mergeRegionsAsync, modifyColumnFamily, modifyColumnFamilyStoreFileTracker, modifyNamespace, modifyTable, modifyTableStoreFileTracker, move, normalize, removeReplicationPeer, removeReplicationPeerTableCFs, replicationPeerModificationSwitch, restoreSnapshot, snapshot, snapshot, snapshot, snapshot, transitReplicationPeerSyncReplicationState, truncateTable, unassign, updateReplicationPeerConfig
private static final org.slf4j.Logger LOG
private volatile boolean aborted
private final Connection conn
private final RawAsyncHBaseAdmin admin
private final int operationTimeout
private final int syncWaitTimeout
public AdminOverAsyncAdmin(Connection conn, RawAsyncHBaseAdmin admin)
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 Connection getConnection()
Admin
getConnection
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 List<TableDescriptor> listTableDescriptors() throws IOException
Admin
listTableDescriptors
in interface Admin
IOException
- if a remote or network exception occurspublic List<TableDescriptor> listTableDescriptors(boolean includeSysTables) throws IOException
Admin
listTableDescriptors
in interface Admin
IOException
- if a remote or network exception occurspublic 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.listTableDescriptors()
public List<TableDescriptor> listTableDescriptorsByState(boolean isEnabled) throws IOException
Admin
listTableDescriptorsByState
in interface Admin
isEnabled
- is true means return enabled tables, false means return disabled tablesIOException
public TableName[] listTableNames() throws IOException
Admin
listTableNames
in interface Admin
IOException
- 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 List<TableName> listTableNamesByState(boolean isEnabled) throws IOException
Admin
listTableNamesByState
in interface Admin
isEnabled
- is true means return enabled table names, false means return disabled table
namesIOException
public 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 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 Future<Void> createTableAsync(TableDescriptor desc) throws IOException
Admin
createTableAsync
in interface Admin
desc
- table descriptor for tableIOException
- if a remote or network exception occurspublic Future<Void> createTableAsync(TableDescriptor desc, byte[][] splitKeys) throws IOException
Admin
createTableAsync
in interface Admin
desc
- table descriptor for tablesplitKeys
- keys to check if the table has been created with all split keysIOException
- if a remote or network exception occurspublic Future<Void> deleteTableAsync(TableName tableName) throws IOException
Admin
deleteTableAsync
in interface Admin
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic Future<Void> truncateTableAsync(TableName tableName, boolean preserveSplits) throws IOException
Admin
truncateTableAsync
in interface Admin
tableName
- name of table to deletepreserveSplits
- true
if the splits should be preservedIOException
- if a remote or network exception occurspublic Future<Void> enableTableAsync(TableName tableName) throws IOException
Admin
enableTableAsync
in interface Admin
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic Future<Void> disableTableAsync(TableName tableName) throws IOException
Admin
disableTableAsync
in interface Admin
tableName
- name of table to deleteIOException
- if a remote or network exception occurspublic 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 Future<Void> addColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
Admin
addColumnFamilyAsync
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 Future<Void> deleteColumnFamilyAsync(TableName tableName, byte[] columnFamily) throws IOException
Admin
deleteColumnFamilyAsync
in interface Admin
tableName
- name of tablecolumnFamily
- name of column family to be deletedIOException
- if a remote or network exception occurspublic Future<Void> modifyColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException
Admin
modifyColumnFamilyAsync
in interface Admin
tableName
- name of tablecolumnFamily
- new column family descriptor to useIOException
- if a remote or network exception occurspublic 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 List<RegionInfo> getRegions(ServerName serverName) throws IOException
Admin
getRegions
in interface Admin
RegionInfo
IOException
- if a remote or network exception occurspublic void flush(TableName tableName) throws IOException
Admin
flush
in interface Admin
tableName
- table to flushIOException
- if a remote or network exception occurspublic void flush(TableName tableName, byte[] columnFamily) throws IOException
Admin
flush
in interface Admin
tableName
- table to flushcolumnFamily
- column family within a tableIOException
- if a remote or network exception occurspublic void flush(TableName tableName, List<byte[]> columnFamilies) throws IOException
Admin
flush
in interface Admin
tableName
- table to flushcolumnFamilies
- column families within a tableIOException
- if a remote or network exception occurspublic void flushRegion(byte[] regionName) throws IOException
Admin
flushRegion
in interface Admin
regionName
- region to flushIOException
- if a remote or network exception occurspublic void flushRegion(byte[] regionName, byte[] columnFamily) throws IOException
Admin
flushRegion
in interface Admin
regionName
- region to flushcolumnFamily
- column family within a regionIOException
- if a remote or network exception occurspublic void flushRegionServer(ServerName serverName) throws IOException
Admin
flushRegionServer
in interface Admin
serverName
- the region server name to flushIOException
- if a remote or network exception occurspublic void compact(TableName tableName) throws IOException
Admin
compact
in interface Admin
tableName
- table to compactIOException
- if a remote or network exception occurspublic void compactRegion(byte[] regionName) throws IOException
Admin
compactRegion
in interface Admin
regionName
- region to compactIOException
- if a remote or network exception occurspublic void compact(TableName tableName, byte[] columnFamily) throws IOException
Admin
compact
in interface Admin
tableName
- table to compactcolumnFamily
- column family within a tableIOException
- if a remote or network exception occurspublic void compactRegion(byte[] regionName, byte[] columnFamily) throws IOException
Admin
compactRegion
in interface Admin
regionName
- region to compactcolumnFamily
- column family within a regionIOException
- if a remote or network exception occurspublic void compact(TableName tableName, CompactType compactType) throws IOException, InterruptedException
Admin
compact
in interface Admin
tableName
- table to compactcompactType
- CompactType
IOException
- if a remote or network exception occursInterruptedException
public void compact(TableName tableName, byte[] columnFamily, CompactType compactType) throws IOException, InterruptedException
Admin
compact
in interface Admin
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
- CompactType
IOException
- if not a mob column family or if a remote or network exception occursInterruptedException
public void majorCompact(TableName tableName) throws IOException
Admin
majorCompact
in interface Admin
tableName
- table to major compactIOException
- if a remote or network exception occurspublic void majorCompactRegion(byte[] regionName) throws IOException
Admin
majorCompactRegion
in interface Admin
regionName
- region to major compactIOException
- if a remote or network exception occurspublic void majorCompact(TableName tableName, byte[] columnFamily) throws IOException
Admin
majorCompact
in interface Admin
tableName
- table to major compactcolumnFamily
- column family within a tableIOException
- if a remote or network exception occurspublic void majorCompactRegion(byte[] regionName, byte[] columnFamily) throws IOException
Admin
majorCompactRegion
in interface Admin
regionName
- egion to major compactcolumnFamily
- column family within a regionIOException
- if a remote or network exception occurspublic void majorCompact(TableName tableName, CompactType compactType) throws IOException, InterruptedException
Admin
majorCompact
in interface Admin
tableName
- table to compactcompactType
- CompactType
IOException
- if a remote or network exception occursInterruptedException
public void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType) throws IOException, InterruptedException
Admin
majorCompact
in interface Admin
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
- CompactType
IOException
- if not a mob column family or if a remote or network exception occursInterruptedException
public Map<ServerName,Boolean> compactionSwitch(boolean switchState, List<String> serverNamesList) throws IOException
Admin
compactionSwitch
in interface Admin
switchState
- Set to true
to enable, false
to disable.serverNamesList
- list of region servers.IOException
- if a remote or network exception occurspublic void compactRegionServer(ServerName serverName) throws IOException
Admin
compactRegionServer
in interface Admin
serverName
- the region server nameIOException
- if a remote or network exception occurspublic void majorCompactRegionServer(ServerName serverName) throws IOException
Admin
majorCompactRegionServer
in interface Admin
serverName
- the region server nameIOException
- if a remote or network exception occurspublic void move(byte[] encodedRegionName) throws IOException
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
.IOException
- if we can't find a region named encodedRegionName
public void move(byte[] encodedRegionName, ServerName destServerName) throws IOException
Admin
encodedRegionName
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
IOException
- if we can't find a region named encodedRegionName
public void assign(byte[] regionName) throws IOException
Admin
assign
in interface Admin
regionName
- Region name to assign.IOException
- if a remote or network exception occurspublic void unassign(byte[] regionName) throws IOException
Admin
unassign
in interface Admin
regionName
- Region name to unassign.IOException
- if a remote or network exception occurspublic void offline(byte[] regionName) throws IOException
Admin
offline
in interface Admin
regionName
- Region to offline.IOException
- if a remote or network exception occurspublic boolean balancerSwitch(boolean onOrOff, boolean synchronous) throws IOException
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.IOException
- if a remote or network exception occurspublic 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 balance() throws IOException
Admin
balance
in interface Admin
true
if balancer ran, false
otherwise.IOException
- if a remote or network exception occurspublic boolean balance(boolean force) throws IOException
Admin
balance
in interface Admin
force
- whether we should force balance even if there is region in transitiontrue
if balancer ran, false
otherwise.IOException
- if a remote or network exception occurspublic boolean isBalancerEnabled() throws IOException
Admin
isBalancerEnabled
in interface Admin
true
if the balancer is enabled, false
otherwise.IOException
- if a remote or network exception occurspublic CacheEvictionStats clearBlockCache(TableName tableName) throws IOException
Admin
clearBlockCache
in interface Admin
tableName
- table to clear block cacheIOException
- if a remote or network exception occurspublic boolean normalize(NormalizeTableFilterParams ntfp) throws IOException
Admin
normalize
in interface Admin
ntfp
- limit to tables matching the specified filter.true
if region normalizer ran, false
otherwise.IOException
- if a remote or network exception occurspublic boolean isNormalizerEnabled() throws IOException
Admin
isNormalizerEnabled
in interface Admin
true
if region normalizer is enabled, false
otherwise.IOException
- if a remote or network exception occurspublic boolean normalizerSwitch(boolean on) throws IOException
Admin
normalizerSwitch
in interface Admin
IOException
- if a remote or network exception occurspublic boolean catalogJanitorSwitch(boolean onOrOff) throws IOException
Admin
catalogJanitorSwitch
in interface Admin
onOrOff
- if true
enables the catalog janitorIOException
- if a remote or network exception occurspublic int runCatalogJanitor() throws IOException
Admin
runCatalogJanitor
in interface Admin
IOException
- if a remote or network exception occurspublic boolean isCatalogJanitorEnabled() throws IOException
Admin
isCatalogJanitorEnabled
in interface Admin
IOException
- if a remote or network exception occurspublic boolean cleanerChoreSwitch(boolean onOrOff) throws IOException
Admin
cleanerChoreSwitch
in interface Admin
onOrOff
- if true
enables the cleaner choreIOException
- if a remote or network exception occurspublic boolean runCleanerChore() throws IOException
Admin
runCleanerChore
in interface Admin
true
if cleaner chore ran, false
otherwiseIOException
- if a remote or network exception occurspublic boolean isCleanerChoreEnabled() throws IOException
Admin
isCleanerChoreEnabled
in interface Admin
IOException
- if a remote or network exception occurspublic Future<Void> mergeRegionsAsync(byte[][] nameOfRegionsToMerge, boolean forcible) throws IOException
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 regionsIOException
- if a remote or network exception occurspublic void split(TableName tableName) throws IOException
Admin
split
in interface Admin
tableName
- table to splitIOException
- if a remote or network exception occurspublic void split(TableName tableName, byte[] splitPoint) throws IOException
Admin
split
in interface Admin
tableName
- table to splitsplitPoint
- the explicit position to split onIOException
- 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 Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint) throws IOException
Admin
splitRegionAsync
in interface Admin
regionName
- region to splitsplitPoint
- the explicit position to split onIOException
- if a remote or network exception occurspublic void truncateRegion(byte[] regionName) throws IOException
Admin
truncateRegion
in interface Admin
regionName
- region to truncateIOException
- if a remote or network exception occurspublic Future<Void> truncateRegionAsync(byte[] regionName)
Admin
truncateRegionAsync
in interface Admin
regionName
- region to truncatepublic Future<Void> modifyTableAsync(TableDescriptor td) throws IOException
Admin
modifyTableAsync
in interface Admin
td
- description of the tableIOException
- if a remote or network exception occurspublic Future<Void> modifyTableAsync(TableDescriptor td, boolean reopenRegions) throws IOException
Admin
Admin.modifyTableAsync(TableDescriptor td)
, except for the reopenRegions
parameter, which controls whether the process of modifying the table should reopen all regions.modifyTableAsync
in interface Admin
td
- description of the tablereopenRegions
- By default, 'modifyTable' reopens all regions, potentially causing a RIT
(Region In Transition) storm in large tables. If set to 'false', regions
will remain unaware of the modification until they are individually
reopened. Please note that this may temporarily result in configuration
inconsistencies among regions.IOException
- 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 occurspublic void shutdown() throws IOException
Admin
shutdown
in interface Admin
IOException
- if a remote or network exception occurspublic void stopMaster() throws IOException
Admin
stopMaster
in interface Admin
IOException
- if a remote or network exception occursAdmin.shutdown()
public boolean isMasterInMaintenanceMode() throws IOException
Admin
isMasterInMaintenanceMode
in interface Admin
IOException
- if a remote or network exception occurspublic void stopRegionServer(String hostnamePort) throws IOException
Admin
stopRegionServer
in interface Admin
hostnamePort
- Hostname and port delimited by a :
as in
example.org:1234
IOException
- if a remote or network exception occurspublic ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options) throws IOException
Admin
ClusterMetrics.Option
to get desired status.getClusterMetrics
in interface Admin
IOException
- if a remote or network exception occurspublic List<RegionMetrics> getRegionMetrics(ServerName serverName) throws IOException
Admin
RegionMetrics
of all regions hosted on a regionserver.getRegionMetrics
in interface Admin
serverName
- region server from which RegionMetrics
is required.RegionMetrics
list of all regions hosted on a region serverIOException
- if a remote or network exception occurspublic List<RegionMetrics> getRegionMetrics(ServerName serverName, TableName tableName) throws IOException
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 tableIOException
- if a remote or network exception occurspublic org.apache.hadoop.conf.Configuration getConfiguration()
Admin
getConfiguration
in interface Admin
public Future<Void> createNamespaceAsync(NamespaceDescriptor descriptor) throws IOException
Admin
createNamespaceAsync
in interface Admin
descriptor
- descriptor which describes the new namespaceIOException
- if a remote or network exception occurspublic Future<Void> modifyNamespaceAsync(NamespaceDescriptor descriptor) throws IOException
Admin
modifyNamespaceAsync
in interface Admin
descriptor
- descriptor which describes the new namespaceIOException
- if a remote or network exception occurspublic Future<Void> deleteNamespaceAsync(String name) throws IOException
Admin
deleteNamespaceAsync
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 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 List<RegionInfo> getRegions(TableName tableName) throws IOException
Admin
getRegions
in interface Admin
tableName
- the name of the tableRegionInfo
.IOException
- if a remote or network exception occurspublic void close()
public 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 Future<Boolean> abortProcedureAsync(long procId, boolean mayInterruptIfRunning) throws IOException
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 existIOException
- if a remote or network exception occurspublic String getProcedures() throws IOException
Admin
getProcedures
in interface Admin
IOException
- if a remote or network exception occurspublic String getLocks() throws IOException
Admin
getLocks
in interface Admin
IOException
- if a remote or network exception occurspublic void rollWALWriter(ServerName serverName) throws IOException, FailedLogCloseException
Admin
rollWALWriter
in interface Admin
serverName
- The servername of the regionserver.IOException
- if a remote or network exception occursFailedLogCloseException
- if we failed to close the WALpublic CompactionState getCompactionState(TableName tableName) throws IOException
Admin
getCompactionState
in interface Admin
tableName
- table to examineIOException
- if a remote or network exception occurspublic CompactionState getCompactionState(TableName tableName, CompactType compactType) throws IOException
Admin
getCompactionState
in interface Admin
tableName
- table to examinecompactType
- CompactType
IOException
- if a remote or network exception occurspublic CompactionState getCompactionStateForRegion(byte[] regionName) throws IOException
Admin
getCompactionStateForRegion
in interface Admin
regionName
- region to examineIOException
- if a remote or network exception occurspublic long getLastMajorCompactionTimestamp(TableName tableName) throws IOException
Admin
getLastMajorCompactionTimestamp
in interface Admin
tableName
- table to examineIOException
- if a remote or network exception occurspublic long getLastMajorCompactionTimestampForRegion(byte[] regionName) throws IOException
Admin
getLastMajorCompactionTimestampForRegion
in interface Admin
regionName
- region to examineIOException
- if a remote or network exception occurspublic void snapshot(SnapshotDescription snapshot) throws IOException, SnapshotCreationException, IllegalArgumentException
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)
unless you are sure
about the type of snapshot that you want to take.snapshot
in interface Admin
snapshot
- snapshot to takeIOException
- or we lose contact with the master.SnapshotCreationException
- if snapshot failed to be takenIllegalArgumentException
- if the snapshot request is formatted incorrectlypublic Future<Void> snapshotAsync(SnapshotDescription snapshot) throws IOException, SnapshotCreationException
Admin
snapshotAsync
in interface Admin
snapshot
- snapshot to takeIOException
- if the snapshot did not succeed or we lose contact with the
master.SnapshotCreationException
- if snapshot creation failedpublic boolean isSnapshotFinished(SnapshotDescription snapshot) throws IOException, HBaseSnapshotException, UnknownSnapshotException
Admin
UnknownSnapshotException
.isSnapshotFinished
in interface Admin
snapshot
- description of the snapshot to checkIOException
- if we have a network issueHBaseSnapshotException
- if the snapshot failedUnknownSnapshotException
- if the requested snapshot is
unknownpublic void restoreSnapshot(String snapshotName) throws IOException, RestoreSnapshotException
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 restoreIOException
- if a remote or network exception occursRestoreSnapshotException
- if snapshot failed to be restoredpublic void restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot, boolean restoreAcl) throws IOException, RestoreSnapshotException
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 snapshotIOException
- if a remote or network exception occursRestoreSnapshotException
- if snapshot failed to be restoredpublic Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean restoreAcl, 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 restoredrestoreAcl
- 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) throws IOException
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 procedureIOException
- if a remote or network exception occurspublic byte[] execProcedureWithReturn(String signature, String instance, Map<String,String> props) throws IOException
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 procedureIOException
- if a remote or network exception occurspublic boolean isProcedureFinished(String signature, String instance, Map<String,String> props) throws IOException
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 runningIOException
- if the specified procedure finished with errorpublic List<SnapshotDescription> listSnapshots() throws IOException
Admin
listSnapshots
in interface Admin
IOException
- if a network error occurspublic List<SnapshotDescription> listSnapshots(Pattern pattern) throws IOException
Admin
listSnapshots
in interface Admin
pattern
- The compiled regular expression to match againstIOException
- if a remote or network exception occurspublic List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException
Admin
listTableSnapshots
in interface Admin
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match againstIOException
- if a remote or network exception occurspublic void deleteSnapshot(String snapshotName) throws IOException
Admin
deleteSnapshot
in interface Admin
snapshotName
- name of the snapshotIOException
- if a remote or network exception occurspublic void deleteSnapshots(Pattern pattern) throws IOException
Admin
deleteSnapshots
in interface Admin
pattern
- pattern for names of the snapshot to matchIOException
- if a remote or network exception occurspublic void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException
Admin
deleteTableSnapshots
in interface Admin
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match againstIOException
- if a remote or network exception occurspublic void setQuota(QuotaSettings quota) throws IOException
Admin
setQuota
in interface Admin
quota
- the quota settingsIOException
- if a remote or network exception occurspublic List<QuotaSettings> getQuota(QuotaFilter filter) throws IOException
Admin
getQuota
in interface Admin
filter
- the quota settings filterIOException
- if a remote or network exception occurspublic 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) throws IOException
Admin
updateConfiguration
in interface Admin
server
- : The server whose config needs to be updated.IOException
- if a remote or network exception occurspublic void updateConfiguration() throws IOException
Admin
updateConfiguration
in interface Admin
IOException
- if a remote or network exception occurspublic void updateConfiguration(String groupName) throws IOException
Admin
updateConfiguration
in interface Admin
groupName
- the group nameIOException
- if a remote or network exception occurspublic List<SecurityCapability> getSecurityCapabilities() throws IOException
Admin
getSecurityCapabilities
in interface Admin
IOException
- if a remote or network exception occurspublic boolean splitSwitch(boolean enabled, boolean synchronous) throws IOException
Admin
splitSwitch
in interface Admin
enabled
- enabled or notsynchronous
- If true
, it waits until current split() call, if outstanding,
to return.IOException
- if a remote or network exception occurspublic boolean mergeSwitch(boolean enabled, boolean synchronous) throws IOException
Admin
mergeSwitch
in interface Admin
enabled
- enabled or notsynchronous
- If true
, it waits until current merge() call, if outstanding,
to return.IOException
- if a remote or network exception occurspublic boolean isSplitEnabled() throws IOException
Admin
isSplitEnabled
in interface Admin
true
if the switch is enabled, false
otherwise.IOException
- if a remote or network exception occurspublic boolean isMergeEnabled() throws IOException
Admin
isMergeEnabled
in interface Admin
true
if the switch is enabled, false
otherwise.IOException
- if a remote or network exception occurspublic Future<Void> addReplicationPeerAsync(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws IOException
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 DISABLEDIOException
- IOException if a remote or network exception occurspublic Future<Void> removeReplicationPeerAsync(String peerId) throws IOException
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 peerIOException
- IOException if a remote or network exception occurspublic Future<Void> enableReplicationPeerAsync(String peerId) throws IOException
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 peerIOException
- IOException if a remote or network exception occurspublic Future<Void> disableReplicationPeerAsync(String peerId) throws IOException
Admin
disableReplicationPeerAsync
in interface Admin
peerId
- a short name that identifies the peerIOException
- IOException if a remote or network exception occurspublic ReplicationPeerConfig getReplicationPeerConfig(String peerId) throws IOException
Admin
getReplicationPeerConfig
in interface Admin
peerId
- a short name that identifies the peerIOException
- if a remote or network exception occurspublic Future<Void> updateReplicationPeerConfigAsync(String peerId, ReplicationPeerConfig peerConfig) throws IOException
Admin
updateReplicationPeerConfigAsync
in interface Admin
peerId
- a short name that identifies the peerpeerConfig
- new config for the replication peerIOException
- IOException if a remote or network exception occurspublic List<ReplicationPeerDescription> listReplicationPeers() throws IOException
Admin
listReplicationPeers
in interface Admin
IOException
- if a remote or network exception occurspublic List<ReplicationPeerDescription> listReplicationPeers(Pattern pattern) throws IOException
Admin
listReplicationPeers
in interface Admin
pattern
- The compiled regular expression to match peer idIOException
- if a remote or network exception occurspublic Future<Void> transitReplicationPeerSyncReplicationStateAsync(String peerId, SyncReplicationState state) throws IOException
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.
transitReplicationPeerSyncReplicationStateAsync
in interface Admin
peerId
- a short name that identifies the peerstate
- a new state of current clusterIOException
- if a remote or network exception occurspublic boolean isReplicationPeerEnabled(String peerId) throws IOException
Admin
isReplicationPeerEnabled
in interface Admin
peerId
- id of replication peer to checktrue
if replication peer is enabledIOException
- if a remote or network exception occurspublic boolean replicationPeerModificationSwitch(boolean on, boolean drainProcedures) throws IOException
Admin
replicationPeerModificationSwitch
in interface Admin
on
- true
means enable, otherwise disabledrainProcedures
- if true
, will wait until all the running replication peer
modification procedures finishIOException
public boolean isReplicationPeerModificationEnabled() throws IOException
Admin
isReplicationPeerModificationEnabled
in interface Admin
true
if modification is enabled, otherwise false
IOException
public void decommissionRegionServers(List<ServerName> servers, boolean offload) throws IOException
Admin
decommissionRegionServers
in interface Admin
servers
- The list of servers to decommission.offload
- True to offload the regions from the decommissioned serversIOException
- if a remote or network exception occurspublic List<ServerName> listDecommissionedRegionServers() throws IOException
Admin
listDecommissionedRegionServers
in interface Admin
IOException
- if a remote or network exception occurspublic void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames) throws IOException
Admin
recommissionRegionServer
in interface Admin
server
- The server to recommission.encodedRegionNames
- Regions to load onto the server.IOException
- if a remote or network exception occurspublic List<TableCFs> listReplicatedTableCFs() throws IOException
Admin
listReplicatedTableCFs
in interface Admin
IOException
- if a remote or network exception occurspublic void enableTableReplication(TableName tableName) throws IOException
Admin
enableTableReplication
in interface Admin
tableName
- name of the tableIOException
- if a remote or network exception occurspublic void disableTableReplication(TableName tableName) throws IOException
Admin
disableTableReplication
in interface Admin
tableName
- name of the tableIOException
- if a remote or network exception occurspublic void clearCompactionQueues(ServerName serverName, Set<String> queues) throws IOException, InterruptedException
Admin
clearCompactionQueues
in interface Admin
serverName
- the region server namequeues
- the set of queue nameIOException
- if a remote or network exception occursInterruptedException
public List<ServerName> clearDeadServers(List<ServerName> servers) throws IOException
Admin
clearDeadServers
in interface Admin
servers
- list of dead region servers.IOException
- if a remote or network exception occurspublic void cloneTableSchema(TableName tableName, TableName newTableName, boolean preserveSplits) throws IOException
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 preservedIOException
- 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 Map<TableName,Long> getSpaceQuotaTableSizes() throws IOException
Admin
getSpaceQuotaTableSizes
in interface Admin
IOException
- if a remote or network exception occurspublic Map<TableName,? extends SpaceQuotaSnapshotView> getRegionServerSpaceQuotaSnapshots(ServerName serverName) throws IOException
Admin
SpaceQuotaSnapshotView
s observed by a RegionServer.getRegionServerSpaceQuotaSnapshots
in interface Admin
IOException
- if a remote or network exception occurspublic SpaceQuotaSnapshotView 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 SpaceQuotaSnapshotView 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) throws IOException
Admin
grant
in interface Admin
userPermission
- user name and the specific permissionmergeExistingPermissions
- If set to false, later granted permissions will override
previous granted permissions. otherwise, it'll merge with
previous granted permissions.IOException
- if a remote or network exception occurspublic void revoke(UserPermission userPermission) throws IOException
Admin
revoke
in interface Admin
userPermission
- user name and the specific permissionIOException
- if a remote or network exception occurspublic List<UserPermission> getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) throws IOException
Admin
getUserPermissions
in interface Admin
getUserPermissionsRequest
- A request contains which user, global, namespace or table
permissions neededIOException
- if a remote or network exception occurspublic List<Boolean> hasUserPermissions(String userName, List<Permission> permissions) throws IOException
Admin
hasUserPermissions
in interface Admin
userName
- the user namepermissions
- the specific permission listIOException
- if a remote or network exception occurspublic boolean snapshotCleanupSwitch(boolean on, boolean synchronous) throws IOException
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.IOException
- if a remote or network exception occurspublic boolean isSnapshotCleanupEnabled() throws IOException
Admin
isSnapshotCleanupEnabled
in interface Admin
true
if the auto snapshot cleanup is enabled, false
otherwise.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 RSGroupInfo getRSGroup(String groupName) throws IOException
Admin
getRSGroup
in interface Admin
groupName
- the group nameIOException
- if a remote or network exception occurspublic void moveServersToRSGroup(Set<Address> servers, String groupName) throws IOException
Admin
moveServersToRSGroup
in interface Admin
servers
- set of servers to movegroupName
- the group to move servers toIOException
- if a remote or network exception occurspublic void addRSGroup(String groupName) throws IOException
Admin
addRSGroup
in interface Admin
groupName
- the name of the groupIOException
- if a remote or network exception occurspublic void removeRSGroup(String groupName) throws IOException
Admin
removeRSGroup
in interface Admin
groupName
- the group nameIOException
- if a remote or network exception occurspublic BalanceResponse balanceRSGroup(String groupName, BalanceRequest request) throws IOException
Admin
BalanceRequest
.balanceRSGroup
in interface Admin
IOException
public List<RSGroupInfo> listRSGroups() throws IOException
Admin
listRSGroups
in interface Admin
IOException
- if a remote or network exception occurspublic List<TableName> listTablesInRSGroup(String groupName) throws IOException
Admin
listTablesInRSGroup
in interface Admin
groupName
- the group nameIOException
- if a remote or network exception occursAdmin.getConfiguredNamespacesAndTablesInRSGroup(String)
public Pair<List<String>,List<TableName>> getConfiguredNamespacesAndTablesInRSGroup(String groupName) throws IOException
Admin
Admin.listTablesInRSGroup(String)
is that, this
method will not include the table which is actually in this RegionServr group but without the
RegionServer group configuration in its TableDescriptor
. For example, we have a group
'A', and we make namespace 'nsA' in this group, then all the tables under this namespace will
in the group 'A', but this method will not return these tables but only the namespace 'nsA',
while the Admin.listTablesInRSGroup(String)
will return all these tables.getConfiguredNamespacesAndTablesInRSGroup
in interface Admin
groupName
- the group nameIOException
- if a remote or network exception occursAdmin.listTablesInRSGroup(String)
public RSGroupInfo getRSGroup(Address hostPort) throws IOException
Admin
getRSGroup
in interface Admin
hostPort
- HostPort to get RSGroupInfo forIOException
- if a remote or network exception occurspublic void removeServersFromRSGroup(Set<Address> servers) throws IOException
Admin
removeServersFromRSGroup
in interface Admin
servers
- set of servers to removeIOException
- if a remote or network exception occurspublic RSGroupInfo getRSGroup(TableName tableName) throws IOException
Admin
getRSGroup
in interface Admin
tableName
- table name to get RSGroupInfo forIOException
- if a remote or network exception occurspublic void setRSGroup(Set<TableName> tables, String groupName) throws IOException
Admin
setRSGroup
in interface Admin
tables
- tables to set group forgroupName
- group name for tablesIOException
- if a remote or network exception occurspublic void renameRSGroup(String oldName, String newName) throws IOException
Admin
renameRSGroup
in interface Admin
oldName
- old rsgroup namenewName
- new rsgroup nameIOException
- if a remote or network exception occurspublic void updateRSGroupConfig(String groupName, Map<String,String> configuration) throws IOException
Admin
updateRSGroupConfig
in interface Admin
groupName
- the group nameconfiguration
- new configuration of the group name to be setIOException
- 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 List<String> getCachedFilesList(ServerName serverName) throws IOException
Admin
getCachedFilesList
in interface Admin
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.