Class ThriftAdmin
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Abortable
,Admin
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client
private org.apache.hadoop.conf.Configuration
private int
private int
private org.apache.thrift.transport.TTransport
-
Constructor Summary
ConstructorDescriptionThriftAdmin
(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client, org.apache.thrift.transport.TTransport tTransport, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Abort the server or client.boolean
abortProcedure
(long procId, boolean mayInterruptIfRunning) Abort a procedure.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.addColumnFamilyAsync
(TableName tableName, ColumnFamilyDescriptor columnFamily) Add a column family to an existing table.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.boolean
balance
(boolean force) Invoke the balancer.balance
(BalanceRequest request) Invoke the balancer with the given balance request.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.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.clearDeadServers
(List<ServerName> servers) Clear dead region servers from master.clearSlowLogResponses
(Set<ServerName> serverNames) Clears online slow/large RPC logs from the provided list of RegionServerscloneSnapshotAsync
(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) UsesAdmin.unassign(byte[], boolean)
to unassign the region.void
closeRegion
(String regionname, String serverName) UsesAdmin.unassign(byte[], boolean)
to unassign the region.void
closeRegion
(ServerName sn, HRegionInfo hri) UsedAdmin.unassign(byte[], boolean)
to unassign the region.boolean
closeRegionWithEncodedRegionName
(String encodedRegionName, String serverName) UsesAdmin.unassign(byte[], boolean)
to unassign the region.void
Compact a table.void
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.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.Creates and returns aRpcChannel
instance connected to the active master.coprocessorService
(ServerName serverName) Creates and returns aRpcChannel
instance connected to the passed region server.void
createNamespace
(NamespaceDescriptor descriptor) Create a new namespace.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.Creates a new table but does not block and wait for it to come online.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.deleteColumnFamilyAsync
(TableName tableName, byte[] columnFamily) Delete a column family from a table.void
deleteNamespace
(String name) Delete an existing namespace.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
(String regex) Delete existing snapshots whose names match the pattern passed.void
deleteSnapshots
(Pattern pattern) Delete existing snapshots whose names match the pattern passed.void
deleteTable
(TableName tableName) Deletes a table.deleteTableAsync
(TableName tableName) Deletes the table but does not block and wait for it to be completely removed.deleteTables
(String regex) Deletes tables matching the passed in pattern and wait on completion.deleteTables
(Pattern pattern) Delete tables matching the passed in pattern and wait on completion.void
deleteTableSnapshots
(String tableNameRegex, String snapshotNameRegex) Delete all existing snapshots matching the given table name regular expression and snapshot name regular expression.void
deleteTableSnapshots
(Pattern tableNamePattern, Pattern snapshotNamePattern) Delete all existing snapshots matching the given table name regular expression and snapshot name regular expression.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.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.disableTables
(String regex) Disable tables matching the passed in pattern and wait on completion.disableTables
(Pattern pattern) Disable tables matching the passed in pattern and wait on completion.enableReplicationPeerAsync
(String peerId) Enable a replication peer but does not block and wait for it.void
enableTable
(TableName tableName) Enable a table.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.enableTables
(String regex) Enable tables matching the passed in pattern and wait on completion.enableTables
(Pattern pattern) Enable tables matching the passed in pattern and wait on completion.boolean
exceedThrottleQuotaSwitch
(boolean enable) Switch the exceed throttle quota.void
Execute a distributed procedure on a cluster.byte[]
Execute a distributed procedure on a cluster.void
Flush a table.void
Flush the specified column family stores on all regions of the passed table.void
Flush the specified column family stores on all regions of the passed table.flushAsync
(TableName tableName, List<byte[]> columnFamilies) Flush a table but does not block and wait for it to finish.void
Flush master local regionvoid
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.getAlterStatus
(byte[] tableName) Get the status ofalter
(a.k.amodify
) command - indicates how many regions have received the updated schema Asynchronous operation.getAlterStatus
(TableName tableName) Get the status of analter
(a.k.amodify
) command - indicates how many regions have received the updated schema Asynchronous operation.getCachedFilesList
(ServerName serverName) Get the list of cached filesgetClusterMetrics
(EnumSet<ClusterMetrics.Option> options) Get cluster status with a set ofClusterMetrics.Option
to get desired status.getCompactionState
(TableName tableName) Get the current compaction state of a table.getCompactionState
(TableName tableName, CompactType compactType) Get the current compaction state of a table.getCompactionStateForRegion
(byte[] regionName) Get the current compaction state of region.org.apache.hadoop.conf.Configuration
Returns Configuration used by the instance.Returns Connection used by this object.getCurrentSpaceQuotaSnapshot
(String namespace) Returns the Master's view of a quota on the givennamespace
or null if the Master has no quota information on that namespace.getCurrentSpaceQuotaSnapshot
(TableName tableName) Returns the Master's view of a quota on the giventableName
or null if the Master has no quota information on that table.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.getLocks()
Get locks.getLogEntries
(Set<ServerName> serverNames, String logType, ServerType serverType, int limit, Map<String, Object> filterParams) Retrieve recent online records from HMaster / RegionServers.getNamespaceDescriptor
(String name) Get a namespace descriptor by name.Get all the online regions on a region server.int
Return the operation timeout for a rpc call.Get procedures.getQuota
(QuotaFilter filter) List the quotas based on the filter.getQuotaRetriever
(QuotaFilter filter) Return a QuotaRetriever to list the quotas based on the filter.getRegionMetrics
(ServerName serverName, TableName tableName) GetRegionMetrics
of all regions hosted on a regionserver for a table.getRegions
(ServerName serverName) Get all the online regions on a region server.getRegions
(TableName tableName) Get the regions of a given table.getRegionServerSpaceQuotaSnapshots
(ServerName serverName) Fetches the observedSpaceQuotaSnapshotView
s observed by a RegionServer.getReplicationPeerConfig
(String peerId) Returns the configured ReplicationPeerConfig for the specified peer.Return the set of supported security capabilities.getSlowLogResponses
(Set<ServerName> serverNames, LogQueryFilter logQueryFilter) Retrieves online slow/large RPC logs from the provided list of RegionServersFetches the table sizes on the filesystem as tracked by the HBase Master.int
Return the blocking wait time for an asynchronous operation.getTableDescriptor
(TableName tableName) Get a table descriptor.getTableDescriptors
(List<String> names) Get tableDescriptors.getTableDescriptorsByTableName
(List<TableName> tableNames) Get tableDescriptors.getTableRegions
(TableName tableName) Get the regions of a given table.getUserPermissions
(GetUserPermissionsRequest getUserPermissionsRequest) Get the global/namespace/table permissions for uservoid
grant
(UserPermission userPermission, boolean mergeExistingPermissions) Grants user specific permissionshasUserPermissions
(String userName, List<Permission> permissions) Check if the user has specific permissionsboolean
Check if the server or client was aborted.boolean
Query the current state of the balancer.boolean
Query on the catalog janitor state (Enabled/Disabled?).boolean
Query on the cleaner chore state (Enabled/Disabled?).boolean
Check whether Master is in maintenance mode.boolean
Query the current state of the merge switch.boolean
Query the current state of the region normalizer.boolean
Check the current state of the specified procedure.boolean
isReplicationPeerEnabled
(String peerId) Check if a replication peer is enabled.boolean
Check whether replication peer modification is enabled.boolean
Get if the rpc throttle is enabled.boolean
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
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 region servers marked as decommissioned, which can not be assigned regions.List available namespace descriptorsString[]
List available namespacesFind all table and column families that are replicated from this clusterReturn a list of replication peers.listReplicationPeers
(Pattern pattern) Return a list of replication peers.List completed snapshots.listSnapshots
(String regex) List all the completed snapshots matching the given regular expression.listSnapshots
(Pattern pattern) List all the completed snapshots matching the given pattern.List all the userspace tables.listTableDescriptors
(List<TableName> tableNames) Get tableDescriptors.listTableDescriptors
(Pattern pattern) List all the userspace tables that match the given pattern.listTableDescriptors
(Pattern pattern, boolean includeSysTables) List all the tables matching the given pattern.listTableDescriptorsByNamespace
(byte[] name) Get list of table descriptors by namespace.Get list of table descriptors by namespace.listTableDescriptorsByState
(boolean isEnabled) List all enabled or disabled tablesList all of the names of userspace tables.listTableNames
(String regex) List all of the names of userspace tables.listTableNames
(String regex, boolean includeSysTables) List all of the names of userspace tables.listTableNames
(Pattern pattern) List all of the names of userspace tables.listTableNames
(Pattern pattern, boolean includeSysTables) List all of the names of userspace tables.Get list of table names by namespace.listTableNamesByState
(boolean isEnabled) List all enabled or disabled table namesList all the userspace tables.listTables
(String regex) List all the userspace tables matching the given regular expression.listTables
(String regex, boolean includeSysTables) List all the tables matching the given pattern.listTables
(Pattern pattern) List all the userspace tables that match the given pattern.listTables
(Pattern pattern, boolean includeSysTables) List all the tables matching the given pattern.listTableSnapshots
(String tableNameRegex, String snapshotNameRegex) List all the completed snapshots matching the given table name regular expression and snapshot name regular expression.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.void
mergeRegions
(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) Merge two regions.mergeRegionsAsync
(byte[][] nameofRegionsToMerge, boolean forcible) Merge multiple regions (>=2).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.modifyColumnFamilyAsync
(TableName tableName, ColumnFamilyDescriptor columnFamily) Modify an existing column family on a table.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.modifyNamespaceAsync
(NamespaceDescriptor descriptor) Modify an existing namespace.void
Modify an existing table, more IRB friendly version.void
modifyTable
(TableName tableName, TableDescriptor td) Modify an existing table, more IRB friendly version.modifyTableAsync
(TableDescriptor td, boolean reopenRegions) Modify an existing table, more IRB (ruby) friendly version.modifyTableAsync
(TableName tableName, TableDescriptor td) Modify an existing table, more IRB friendly version.modifyTableStoreFileTrackerAsync
(TableName tableName, String dstSFT) Change the store file tracker of the given table.void
move
(byte[] encodedRegionName) Move the regionencodedRegionName
to a random server.void
move
(byte[] encodedRegionName, ServerName destServerName) Move the regionrencodedRegionName
todestServerName
.boolean
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.removeReplicationPeerAsync
(String peerId) Remove a replication peer but does not block and wait for it.boolean
replicationPeerModificationSwitch
(boolean on, boolean drainProcedures) Enable or disable replication peer modification.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.restoreSnapshotAsync
(String snapshotName) Restore the specified snapshot on the original table.void
revoke
(UserPermission userPermission) Revokes user specific permissionsvoid
rollWALWriter
(ServerName serverName) Roll the log writer.int
Ask for a scan of the catalog table.boolean
Ask for cleaner chore to run.void
setQuota
(QuotaSettings quota) Apply the new quota settings.void
shutdown()
Shuts down the HBase cluster.void
Create a timestamp consistent snapshot for the given table.void
Take a snapshot for the given table.void
snapshot
(String snapshotName, TableName tableName, SnapshotType type) Create typed snapshot of the table.void
snapshot
(SnapshotDescription snapshot) Take a snapshot and wait for the server to complete that snapshot (blocking).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 a table.void
Split a table.void
splitRegion
(byte[] regionName) Split an individual region.void
splitRegion
(byte[] regionName, byte[] splitPoint) Split an individual region.splitRegionAsync
(byte[] regionName) Split an individual region.splitRegionAsync
(byte[] regionName, byte[] splitPoint) Split an individual region.boolean
splitSwitch
(boolean enabled, boolean synchronous) Turn the split switch on or off.void
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
truncateRegion
(byte[] regionName) Truncate an individual region.truncateRegionAsync
(byte[] regionName) Truncate an individual region.void
truncateTable
(TableName tableName, boolean preserveSplits) Truncate a table.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
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.updateReplicationPeerConfigAsync
(String peerId, ReplicationPeerConfig peerConfig) Update the peerConfig for the specified peer but does not block and wait for it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.client.Admin
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, modifyTable, modifyTableAsync, modifyTableStoreFileTracker, move, normalize, removeReplicationPeer, removeReplicationPeerTableCFs, replicationPeerModificationSwitch, restoreSnapshot, restoreSnapshot, runCatalogScan, setBalancerRunning, setCleanerChoreRunning, setNormalizerRunning, setSplitOrMergeEnabled, snapshot, snapshot, takeSnapshotAsync, unassign, updateReplicationPeerConfig
-
Field Details
-
client
-
transport
-
operationTimeout
-
syncWaitTimeout
-
conf
-
-
Constructor Details
-
ThriftAdmin
public ThriftAdmin(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client, org.apache.thrift.transport.TTransport tTransport, org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
getOperationTimeout
Description copied from interface:Admin
Return the operation timeout for a rpc call.- Specified by:
getOperationTimeout
in interfaceAdmin
- See Also:
-
getSyncWaitTimeout
Description copied from interface:Admin
Return the blocking wait time for an asynchronous operation. Can be configured byhbase.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 aboveAdmin.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).- Specified by:
getSyncWaitTimeout
in interfaceAdmin
- See Also:
-
abort
Description copied from interface:Abortable
Abort the server or client. -
isAborted
Description copied from interface:Abortable
Check if the server or client was aborted. -
close
- Specified by:
close
in interfaceAdmin
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getConfiguration
Description copied from interface:Admin
Returns Configuration used by the instance.- Specified by:
getConfiguration
in interfaceAdmin
-
tableExists
Description copied from interface:Admin
Check if a table exists.- Specified by:
tableExists
in interfaceAdmin
- Parameters:
tableName
- Table to check.- Returns:
true
if table exists already.- Throws:
IOException
- if a remote or network exception occurs
-
getConnection
Description copied from interface:Admin
Returns Connection used by this object.- Specified by:
getConnection
in interfaceAdmin
-
listTables
Description copied from interface:Admin
List all the userspace tables.- Specified by:
listTables
in interfaceAdmin
- Returns:
- an array of read-only HTableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTableDescriptors
Description copied from interface:Admin
List all the userspace tables.- Specified by:
listTableDescriptors
in interfaceAdmin
- Returns:
- a list of TableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
listTableDescriptorsByState
Description copied from interface:Admin
List all enabled or disabled tables- Specified by:
listTableDescriptorsByState
in interfaceAdmin
- Parameters:
isEnabled
- is true means return enabled tables, false means return disabled tables- Returns:
- a list of enabled or disabled tables
- Throws:
IOException
-
listTables
Description copied from interface:Admin
List all the userspace tables that match the given pattern.- Specified by:
listTables
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match against- Returns:
- an array of read-only HTableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTableDescriptors
Description copied from interface:Admin
List all the userspace tables that match the given pattern.- Specified by:
listTableDescriptors
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match against- Returns:
- a list of TableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTables
Description copied from interface:Admin
List all the userspace tables matching the given regular expression.- Specified by:
listTables
in interfaceAdmin
- Parameters:
regex
- The regular expression to match against- Returns:
- a list of read-only HTableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTables
Description copied from interface:Admin
List all the tables matching the given pattern.- Specified by:
listTables
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match againstincludeSysTables
-false
to match only against userspace tables- Returns:
- an array of read-only HTableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTableDescriptors
public List<TableDescriptor> listTableDescriptors(Pattern pattern, boolean includeSysTables) throws IOException Description copied from interface:Admin
List all the tables matching the given pattern.- Specified by:
listTableDescriptors
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match againstincludeSysTables
-false
to match only against userspace tables- Returns:
- a list of TableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTables
Description copied from interface:Admin
List all the tables matching the given pattern.- Specified by:
listTables
in interfaceAdmin
- Parameters:
regex
- The regular expression to match againstincludeSysTables
-false
to match only against userspace tables- Returns:
- an array of read-only HTableDescriptors
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
listTableNames
Description copied from interface:Admin
List all of the names of userspace tables.- Specified by:
listTableNames
in interfaceAdmin
- Returns:
- TableName[] table names
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNames
Description copied from interface:Admin
List all of the names of userspace tables.- Specified by:
listTableNames
in interfaceAdmin
- Parameters:
pattern
- The regular expression to match against- Returns:
- array of table names
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNames
Description copied from interface:Admin
List all of the names of userspace tables.- Specified by:
listTableNames
in interfaceAdmin
- Parameters:
regex
- The regular expression to match against- Returns:
- TableName[] table names
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNames
Description copied from interface:Admin
List all of the names of userspace tables.- Specified by:
listTableNames
in interfaceAdmin
- Parameters:
pattern
- The regular expression to match againstincludeSysTables
-false
to match only against userspace tables- Returns:
- TableName[] table names
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNames
Description copied from interface:Admin
List all of the names of userspace tables.- Specified by:
listTableNames
in interfaceAdmin
- Parameters:
regex
- The regular expression to match againstincludeSysTables
-false
to match only against userspace tables- Returns:
- TableName[] table names
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNamesByState
Description copied from interface:Admin
List all enabled or disabled table names- Specified by:
listTableNamesByState
in interfaceAdmin
- Parameters:
isEnabled
- is true means return enabled table names, false means return disabled table names- Returns:
- a list of enabled or disabled table names
- Throws:
IOException
-
getTableDescriptor
public HTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, IOException Description copied from interface:Admin
Get a table descriptor.- Specified by:
getTableDescriptor
in interfaceAdmin
- Parameters:
tableName
- as aTableName
- Returns:
- the read-only tableDescriptor
- Throws:
TableNotFoundException
- if the table was not foundIOException
- if a remote or network exception occurs
-
getDescriptor
public TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundException, IOException Description copied from interface:Admin
Get a table descriptor.- Specified by:
getDescriptor
in interfaceAdmin
- Parameters:
tableName
- as aTableName
- Returns:
- the tableDescriptor
- Throws:
TableNotFoundException
- if the table was not foundIOException
- if a remote or network exception occurs
-
listTableDescriptorsByNamespace
Description copied from interface:Admin
Get list of table descriptors by namespace.- Specified by:
listTableDescriptorsByNamespace
in interfaceAdmin
- Parameters:
name
- namespace name- Returns:
- HTD[] the read-only tableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
listTableDescriptorsByNamespace
Description copied from interface:Admin
Get list of table descriptors by namespace.- Specified by:
listTableDescriptorsByNamespace
in interfaceAdmin
- Parameters:
name
- namespace name- Returns:
- returns a list of TableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
listTableNamesByNamespace
Description copied from interface:Admin
Get list of table names by namespace.- Specified by:
listTableNamesByNamespace
in interfaceAdmin
- Parameters:
name
- namespace name- Returns:
- The list of table names in the namespace
- Throws:
IOException
- if a remote or network exception occurs
-
createTable
Description copied from interface:Admin
Creates a new table. Synchronous operation.- Specified by:
createTable
in interfaceAdmin
- Parameters:
desc
- table descriptor for table- Throws:
MasterNotRunningException
- if master is not runningTableExistsException
- if table already exists (If concurrent threads, the table may have been created between test-for-existence and attempt-at-creation).IOException
- if a remote or network exception occurs
-
createTable
public void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) throws IOException Description copied from interface:Admin
Creates a new table with the specified number of regions. The start key specified will become the end key of the first region of the table, and the end key specified will become the start key of the last region of the table (the first region has a null start key and the last region has a null end key). BigInteger math will be used to divide the key range specified into enough segments to make the required number of total regions. Synchronous operation.- Specified by:
createTable
in interfaceAdmin
- Parameters:
desc
- table descriptor for tablestartKey
- beginning of key rangeendKey
- end of key rangenumRegions
- the total number of regions to create- Throws:
IOException
- 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).
-
createTable
Description copied from interface:Admin
Creates a new table with an initial set of empty regions defined by the specified split keys. The total number of regions created will be the number of split keys plus one. Synchronous operation. Note : Avoid passing empty split key.- Specified by:
createTable
in interfaceAdmin
- Parameters:
desc
- table descriptor for tablesplitKeys
- array of split keys for the initial regions of the table- Throws:
MasterNotRunningException
- if master is not runningTableExistsException
- if table already exists (If concurrent threads, the table may have been created between test-for-existence and attempt-at-creation).IOException
- if a remote or network exception occurs
-
deleteTable
Description copied from interface:Admin
Deletes a table. Synchronous operation.- Specified by:
deleteTable
in interfaceAdmin
- Parameters:
tableName
- name of table to delete- Throws:
IOException
- if a remote or network exception occurs
-
truncateTable
Description copied from interface:Admin
Truncate a table. Synchronous operation.- Specified by:
truncateTable
in interfaceAdmin
- Parameters:
tableName
- name of table to truncatepreserveSplits
-true
if the splits should be preserved- Throws:
IOException
- if a remote or network exception occurs
-
enableTable
Description copied from interface:Admin
Enable a table. May timeout. UseAdmin.enableTableAsync(org.apache.hadoop.hbase.TableName)
andAdmin.isTableEnabled(org.apache.hadoop.hbase.TableName)
instead. The table has to be in disabled state for it to be enabled.- Specified by:
enableTable
in interfaceAdmin
- Parameters:
tableName
- name of the table- Throws:
IOException
- if a remote or network exception occurs There could be couple types of IOException TableNotFoundException means the table doesn't exist. TableNotDisabledException means the table isn't in disabled state.- See Also:
-
disableTable
Description copied from interface:Admin
Disable table and wait on completion. May timeout eventually. UseAdmin.disableTableAsync(org.apache.hadoop.hbase.TableName)
andAdmin.isTableDisabled(org.apache.hadoop.hbase.TableName)
instead. The table has to be in enabled state for it to be disabled.- Specified by:
disableTable
in interfaceAdmin
- 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.
-
isTableEnabled
Description copied from interface:Admin
Check if a table is enabled.- Specified by:
isTableEnabled
in interfaceAdmin
- Parameters:
tableName
- name of table to check- Returns:
true
if table is on-line- Throws:
IOException
- if a remote or network exception occurs
-
isTableDisabled
Description copied from interface:Admin
Check if a table is disabled.- Specified by:
isTableDisabled
in interfaceAdmin
- Parameters:
tableName
- name of table to check- Returns:
true
if table is off-line- Throws:
IOException
- if a remote or network exception occurs
-
isTableAvailable
Description copied from interface:Admin
Check if a table is available.- Specified by:
isTableAvailable
in interfaceAdmin
- Parameters:
tableName
- name of table to check- Returns:
true
if all regions of the table are available- Throws:
IOException
- if a remote or network exception occurs
-
isTableAvailable
Description copied from interface:Admin
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. Note : If this api is used after a table's region gets splitted, the api may returnfalse
.- Specified by:
isTableAvailable
in interfaceAdmin
- Parameters:
tableName
- name of table to checksplitKeys
- keys to check if the table has been created with all split keys- Throws:
IOException
- if a remote or network excpetion occurs
-
addColumnFamily
public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException Description copied from interface:Admin
Add a column family to an existing table. Synchronous operation. UseAdmin.addColumnFamilyAsync(TableName, ColumnFamilyDescriptor)
instead because it returns aFuture
from which you can learn whether success or failure.- Specified by:
addColumnFamily
in interfaceAdmin
- Parameters:
tableName
- name of the table to add column family tocolumnFamily
- column family descriptor of column family to be added- Throws:
IOException
- if a remote or network exception occurs
-
deleteColumn
Description copied from interface:Admin
Delete a column family from a table. Synchronous operation. UseAdmin.deleteColumnFamily(TableName, byte[])
instead because it returns aFuture
from which you can learn whether success or failure.- Specified by:
deleteColumn
in interfaceAdmin
- Parameters:
tableName
- name of tablecolumnFamily
- name of column family to be deleted- Throws:
IOException
- if a remote or network exception occurs
-
deleteColumnFamily
Description copied from interface:Admin
Delete a column family from a table. Synchronous operation. UseAdmin.deleteColumnFamily(TableName, byte[])
instead because it returns aFuture
from which you can learn whether success or failure.- Specified by:
deleteColumnFamily
in interfaceAdmin
- Parameters:
tableName
- name of tablecolumnFamily
- name of column family to be deleted- Throws:
IOException
- if a remote or network exception occurs
-
modifyColumnFamily
public void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException Description copied from interface:Admin
Modify an existing column family on a table. Synchronous operation. UseAdmin.modifyColumnFamilyAsync(TableName, ColumnFamilyDescriptor)
instead because it returns aFuture
from which you can learn whether success or failure.- Specified by:
modifyColumnFamily
in interfaceAdmin
- Parameters:
tableName
- name of tablecolumnFamily
- new column family descriptor to use- Throws:
IOException
- if a remote or network exception occurs
-
modifyTable
Description copied from interface:Admin
Modify an existing table, more IRB friendly version.- Specified by:
modifyTable
in interfaceAdmin
- Parameters:
tableName
- name of table.td
- modified description of the table- Throws:
IOException
- if a remote or network exception occurs
-
modifyTable
Description copied from interface:Admin
Modify an existing table, more IRB friendly version.- Specified by:
modifyTable
in interfaceAdmin
- Parameters:
td
- modified description of the table- Throws:
IOException
- if a remote or network exception occurs
-
modifyNamespace
Description copied from interface:Admin
Modify an existing namespace. Blocks until namespace has been successfully modified or an exception is thrown.- Specified by:
modifyNamespace
in interfaceAdmin
- Parameters:
descriptor
- descriptor which describes the new namespace- Throws:
IOException
- if a remote or network exception occurs
-
deleteNamespace
Description copied from interface:Admin
Delete an existing namespace. Only empty namespaces (no tables) can be removed. Blocks until namespace has been successfully deleted or an exception is thrown.- Specified by:
deleteNamespace
in interfaceAdmin
- Parameters:
name
- namespace name- Throws:
IOException
- if a remote or network exception occurs
-
getNamespaceDescriptor
public NamespaceDescriptor getNamespaceDescriptor(String name) throws NamespaceNotFoundException, IOException Description copied from interface:Admin
Get a namespace descriptor by name.- Specified by:
getNamespaceDescriptor
in interfaceAdmin
- Parameters:
name
- name of namespace descriptor- Returns:
- A descriptor
- Throws:
NamespaceNotFoundException
- if the namespace was not foundIOException
- if a remote or network exception occurs
-
listNamespaces
Description copied from interface:Admin
List available namespaces- Specified by:
listNamespaces
in interfaceAdmin
- Returns:
- List of namespace names
- Throws:
IOException
- if a remote or network exception occurs
-
listNamespaceDescriptors
Description copied from interface:Admin
List available namespace descriptors- Specified by:
listNamespaceDescriptors
in interfaceAdmin
- Returns:
- List of descriptors
- Throws:
IOException
- if a remote or network exception occurs
-
createNamespace
Description copied from interface:Admin
Create a new namespace. Blocks until namespace has been successfully created or an exception is thrown.- Specified by:
createNamespace
in interfaceAdmin
- Parameters:
descriptor
- descriptor which describes the new namespace.- Throws:
IOException
- if a remote or network exception occurs
-
switchRpcThrottle
Description copied from interface:Admin
Switch the rpc throttle enable state.- Specified by:
switchRpcThrottle
in interfaceAdmin
- Parameters:
enable
- Set totrue
to enable,false
to disable.- Returns:
- Previous rpc throttle enabled value
- Throws:
IOException
- if a remote or network exception occurs
-
isRpcThrottleEnabled
Description copied from interface:Admin
Get if the rpc throttle is enabled.- Specified by:
isRpcThrottleEnabled
in interfaceAdmin
- Returns:
- True if rpc throttle is enabled
- Throws:
IOException
- if a remote or network exception occurs
-
exceedThrottleQuotaSwitch
Description copied from interface:Admin
Switch the exceed throttle quota. If enabled, user/table/namespace throttle quota can be exceeded if region server has availble quota.- Specified by:
exceedThrottleQuotaSwitch
in interfaceAdmin
- Parameters:
enable
- Set totrue
to enable,false
to disable.- Returns:
- Previous exceed throttle enabled value
- Throws:
IOException
- if a remote or network exception occurs
-
disableTables
Description copied from interface:Admin
Disable tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(Pattern)
andAdmin.disableTable(org.apache.hadoop.hbase.TableName)
- Specified by:
disableTables
in interfaceAdmin
- Parameters:
regex
- The regular expression to match table names against- Returns:
- Table descriptors for tables that couldn't be disabled The return htds are read-only
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
disableTables
Description copied from interface:Admin
Disable tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(java.util.regex.Pattern)
andAdmin.disableTable(org.apache.hadoop.hbase.TableName)
- Specified by:
disableTables
in interfaceAdmin
- Parameters:
pattern
- The pattern to match table names against- Returns:
- Table descriptors for tables that couldn't be disabled The return htds are read-only
- Throws:
IOException
- if a remote or network exception occurs
-
enableTables
Description copied from interface:Admin
Enable tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(Pattern)
andAdmin.enableTable(org.apache.hadoop.hbase.TableName)
- Specified by:
enableTables
in interfaceAdmin
- Parameters:
regex
- The regular expression to match table names against- Returns:
- Table descriptors for tables that couldn't be enabled. The return HTDs are read-only.
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
enableTables
Description copied from interface:Admin
Enable tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(java.util.regex.Pattern)
andAdmin.enableTable(org.apache.hadoop.hbase.TableName)
- Specified by:
enableTables
in interfaceAdmin
- Parameters:
pattern
- The pattern to match table names against- Returns:
- Table descriptors for tables that couldn't be enabled. The return HTDs are read-only.
- Throws:
IOException
- if a remote or network exception occurs
-
deleteTables
Description copied from interface:Admin
Deletes tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(Pattern)
andAdmin.deleteTable(org.apache.hadoop.hbase.TableName)
- Specified by:
deleteTables
in interfaceAdmin
- Parameters:
regex
- The regular expression to match table names against- Returns:
- Table descriptors for tables that couldn't be deleted. The return htds are read-only
- Throws:
IOException
- if a remote or network exception occurs- See Also:
-
deleteTables
Description copied from interface:Admin
Delete tables matching the passed in pattern and wait on completion. Warning: Use this method carefully, there is no prompting and the effect is immediate. Consider usingAdmin.listTableDescriptors(java.util.regex.Pattern)
andAdmin.deleteTable(org.apache.hadoop.hbase.TableName)
- Specified by:
deleteTables
in interfaceAdmin
- Parameters:
pattern
- The pattern to match table names against- Returns:
- Table descriptors for tables that couldn't be deleted The return htds are read-only
- Throws:
IOException
- if a remote or network exception occurs
-
getTableDescriptorsByTableName
public HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames) throws IOException Description copied from interface:Admin
Get tableDescriptors.- Specified by:
getTableDescriptorsByTableName
in interfaceAdmin
- Parameters:
tableNames
- List of table names- Returns:
- HTD[] the read-only tableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
listTableDescriptors
Description copied from interface:Admin
Get tableDescriptors.- Specified by:
listTableDescriptors
in interfaceAdmin
- Parameters:
tableNames
- List of table names- Returns:
- returns a list of TableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
getTableDescriptors
Description copied from interface:Admin
Get tableDescriptors.- Specified by:
getTableDescriptors
in interfaceAdmin
- Parameters:
names
- List of table names- Returns:
- HTD[] the read-only tableDescriptors
- Throws:
IOException
- if a remote or network exception occurs
-
closeRegion
Description copied from interface:Admin
UsesAdmin.unassign(byte[], boolean)
to unassign the region. For expert-admins.- Specified by:
closeRegion
in interfaceAdmin
- Parameters:
regionname
- region name to closeserverName
- Deprecated. Not used.
-
closeRegion
Description copied from interface:Admin
UsesAdmin.unassign(byte[], boolean)
to unassign the region. For expert-admins.- Specified by:
closeRegion
in interfaceAdmin
- Parameters:
regionname
- region name to closeserverName
- Deprecated. Not used.
-
closeRegionWithEncodedRegionName
Description copied from interface:Admin
UsesAdmin.unassign(byte[], boolean)
to unassign the region. For expert-admins.- Specified by:
closeRegionWithEncodedRegionName
in interfaceAdmin
- Parameters:
encodedRegionName
- The encoded region name; i.e. the hash that makes up the region name suffix: e.g. if regionname isTestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
, then the encoded region name is:527db22f95c8a9e0116f0cc13c680396
.serverName
- Deprecated. Not used.- Returns:
- Deprecated. Returns
true
always.
-
closeRegion
Description copied from interface:Admin
UsedAdmin.unassign(byte[], boolean)
to unassign the region. For expert-admins.- Specified by:
closeRegion
in interfaceAdmin
- Parameters:
sn
- Deprecated. Not used.
-
getOnlineRegions
Description copied from interface:Admin
Get all the online regions on a region server.- Specified by:
getOnlineRegions
in interfaceAdmin
-
getRegions
Description copied from interface:Admin
Get all the online regions on a region server.- Specified by:
getRegions
in interfaceAdmin
- Returns:
- List of
RegionInfo
-
flush
Description copied from interface:Admin
Flush a table. Synchronous operation. -
flush
Description copied from interface:Admin
Flush the specified column family stores on all regions of the passed table. This runs as a synchronous operation. -
flushRegion
Description copied from interface:Admin
Flush an individual region. Synchronous operation.- Specified by:
flushRegion
in interfaceAdmin
- Parameters:
regionName
- region to flush
-
flushRegion
Description copied from interface:Admin
Flush a column family within a region. Synchronous operation.- Specified by:
flushRegion
in interfaceAdmin
- Parameters:
regionName
- region to flushcolumnFamily
- column family within a region
-
flushRegionServer
Description copied from interface:Admin
Flush all regions on the region server. Synchronous operation.- Specified by:
flushRegionServer
in interfaceAdmin
- Parameters:
serverName
- the region server name to flush
-
compact
Description copied from interface:Admin
Compact a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while). -
compactRegion
Description copied from interface:Admin
Compact an individual region. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
compactRegion
in interfaceAdmin
- Parameters:
regionName
- region to compact
-
compact
Description copied from interface:Admin
Compact a column family within a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while). -
compactRegion
Description copied from interface:Admin
Compact a column family within a region. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
compactRegion
in interfaceAdmin
- Parameters:
regionName
- region to compactcolumnFamily
- column family within a region
-
compact
Description copied from interface:Admin
Compact a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
compact
in interfaceAdmin
- Parameters:
tableName
- table to compactcompactType
-CompactType
-
compact
Description copied from interface:Admin
Compact a column family within a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
compact
in interfaceAdmin
- Parameters:
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
-CompactType
-
majorCompact
Description copied from interface:Admin
Major compact a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompact
in interfaceAdmin
- Parameters:
tableName
- table to major compact
-
majorCompactRegion
Description copied from interface:Admin
Major compact a table or an individual region. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompactRegion
in interfaceAdmin
- Parameters:
regionName
- region to major compact
-
majorCompact
Description copied from interface:Admin
Major compact a column family within a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompact
in interfaceAdmin
- Parameters:
tableName
- table to major compactcolumnFamily
- column family within a table
-
majorCompactRegion
Description copied from interface:Admin
Major compact a column family within region. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompactRegion
in interfaceAdmin
- Parameters:
regionName
- egion to major compactcolumnFamily
- column family within a region
-
majorCompact
Description copied from interface:Admin
Major compact a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompact
in interfaceAdmin
- Parameters:
tableName
- table to compactcompactType
-CompactType
-
majorCompact
Description copied from interface:Admin
Major compact a column family within a table. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompact
in interfaceAdmin
- Parameters:
tableName
- table to compactcolumnFamily
- column family within a tablecompactType
-CompactType
-
compactionSwitch
Description copied from interface:Admin
Turn the compaction on or off. Disabling compactions will also interrupt any currently ongoing compactions. This state is ephemeral. The setting will be lost on restart. Compaction can also be enabled/disabled by modifying configuration hbase.regionserver.compaction.enabled in hbase-site.xml.- Specified by:
compactionSwitch
in interfaceAdmin
- Parameters:
switchState
- Set totrue
to enable,false
to disable.serverNamesList
- list of region servers.- Returns:
- Previous compaction states for region servers
-
compactRegionServer
Description copied from interface:Admin
Compact all regions on the region server. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
compactRegionServer
in interfaceAdmin
- Parameters:
serverName
- the region server name
-
majorCompactRegionServer
Description copied from interface:Admin
Major compact all regions on the region server. Asynchronous operation in that this method requests that a Compaction run and then it returns. It does not wait on the completion of Compaction (it can take a while).- Specified by:
majorCompactRegionServer
in interfaceAdmin
- Parameters:
serverName
- the region server name
-
move
Description copied from interface:Admin
Move the regionencodedRegionName
to a random server.- Specified by:
move
in interfaceAdmin
- Parameters:
encodedRegionName
- The encoded region name; i.e. the hash that makes up the region name suffix: e.g. if regionname isTestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
, then the encoded region name is:527db22f95c8a9e0116f0cc13c680396
.
-
move
Description copied from interface:Admin
Move the regionrencodedRegionName
todestServerName
.- Specified by:
move
in interfaceAdmin
- Parameters:
encodedRegionName
- The encoded region name; i.e. the hash that makes up the region name suffix: e.g. if regionname isTestTable,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
-
assign
Description copied from interface:Admin
Assign a Region. -
unassign
Description copied from interface:Admin
Unassign a Region. -
offline
Description copied from interface:Admin
Offline specified region from master's in-memory state. It will not attempt to reassign the region as in unassign. This API can be used when a region not served by any region server and still online as per Master's in memory state. If this API is incorrectly used on active region then master will loose track of that region. This is a special method that should be used by experts or hbck. -
balancerSwitch
Description copied from interface:Admin
Turn the load balancer on or off.- Specified by:
balancerSwitch
in interfaceAdmin
- Parameters:
onOrOff
- Set totrue
to enable,false
to disable.synchronous
- Iftrue
, it waits until current balance() call, if outstanding, to return.- Returns:
- Previous balancer value
-
balance
Description copied from interface:Admin
Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the reassignments. Can NOT run for various reasons. Check logs. -
balance
Description copied from interface:Admin
Invoke the balancer. Will run the balancer and if regions to move, it will go ahead and do the reassignments. If there is region in transition, force parameter of true would still run balancer. Can *not* run for other reasons. Check logs. -
balance
Description copied from interface:Admin
Invoke the balancer with the given balance request. The BalanceRequest defines how the balancer will run. SeeBalanceRequest
for more details.- Specified by:
balance
in interfaceAdmin
- Parameters:
request
- defines how the balancer should run- Returns:
BalanceResponse
with details about the results of the invocation.- Throws:
IOException
- if a remote or network exception occurs
-
isBalancerEnabled
Description copied from interface:Admin
Query the current state of the balancer.- Specified by:
isBalancerEnabled
in interfaceAdmin
- Returns:
true
if the balancer is enabled,false
otherwise.
-
clearBlockCache
Description copied from interface:Admin
Clear all the blocks corresponding to this table from BlockCache. For expert-admins. Calling this API will drop all the cached blocks specific to a table from BlockCache. This can significantly impact the query performance as the subsequent queries will have to retrieve the blocks from underlying filesystem.- Specified by:
clearBlockCache
in interfaceAdmin
- Parameters:
tableName
- table to clear block cache- Returns:
- CacheEvictionStats related to the eviction
-
normalize
Description copied from interface:Admin
Invoke region normalizer. Can NOT run for various reasons. Check logs. This is a non-blocking invocation to region normalizer. If return value is true, it means the request was submitted successfully. We need to check logs for the details of which regions were split/merged. -
isNormalizerEnabled
Description copied from interface:Admin
Query the current state of the region normalizer.- Specified by:
isNormalizerEnabled
in interfaceAdmin
- Returns:
true
if region normalizer is enabled,false
otherwise.
-
normalizerSwitch
Description copied from interface:Admin
Turn region normalizer on or off.- Specified by:
normalizerSwitch
in interfaceAdmin
- Returns:
- Previous normalizer value
-
catalogJanitorSwitch
Description copied from interface:Admin
Enable/Disable the catalog janitor/- Specified by:
catalogJanitorSwitch
in interfaceAdmin
- Parameters:
onOrOff
- iftrue
enables the catalog janitor- Returns:
- the previous state
-
runCatalogJanitor
Description copied from interface:Admin
Ask for a scan of the catalog table.- Specified by:
runCatalogJanitor
in interfaceAdmin
- Returns:
- the number of entries cleaned
-
isCatalogJanitorEnabled
Description copied from interface:Admin
Query on the catalog janitor state (Enabled/Disabled?).- Specified by:
isCatalogJanitorEnabled
in interfaceAdmin
-
cleanerChoreSwitch
Description copied from interface:Admin
Enable/Disable the cleaner chore.- Specified by:
cleanerChoreSwitch
in interfaceAdmin
- Parameters:
onOrOff
- iftrue
enables the cleaner chore- Returns:
- the previous state
-
runCleanerChore
Description copied from interface:Admin
Ask for cleaner chore to run.- Specified by:
runCleanerChore
in interfaceAdmin
- Returns:
true
if cleaner chore ran,false
otherwise
-
isCleanerChoreEnabled
Description copied from interface:Admin
Query on the cleaner chore state (Enabled/Disabled?).- Specified by:
isCleanerChoreEnabled
in interfaceAdmin
-
mergeRegions
Description copied from interface:Admin
Merge two regions. Asynchronous operation.- Specified by:
mergeRegions
in interfaceAdmin
- Parameters:
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 regions
-
mergeRegionsAsync
Description copied from interface:Admin
Merge two regions. Asynchronous operation.- Specified by:
mergeRegionsAsync
in interfaceAdmin
- Parameters:
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 regions
-
mergeRegionsAsync
Description copied from interface:Admin
Merge multiple regions (>=2). Asynchronous operation.- Specified by:
mergeRegionsAsync
in interfaceAdmin
- Parameters:
nameofRegionsToMerge
- encoded or full name of daughter regionsforcible
-true
if do a compulsory merge, otherwise we will only merge adjacent regions
-
split
Description copied from interface:Admin
Split a table. The method will execute split action for each region in table. Asynchronous operation. -
splitRegion
Description copied from interface:Admin
Split an individual region. Asynchronous operation.- Specified by:
splitRegion
in interfaceAdmin
- Parameters:
regionName
- region to split
-
split
Description copied from interface:Admin
Split a table. Asynchronous operation. -
truncateRegion
Description copied from interface:Admin
Truncate an individual region.- Specified by:
truncateRegion
in interfaceAdmin
- Parameters:
regionName
- region to truncate- Throws:
IOException
- if a remote or network exception occurs
-
truncateRegionAsync
Description copied from interface:Admin
Truncate an individual region. Asynchronous operation.- Specified by:
truncateRegionAsync
in interfaceAdmin
- Parameters:
regionName
- region to truncate
-
getCachedFilesList
Get the list of cached files- Specified by:
getCachedFilesList
in interfaceAdmin
-
splitRegion
Description copied from interface:Admin
Split an individual region. Asynchronous operation.- Specified by:
splitRegion
in interfaceAdmin
- Parameters:
regionName
- region to splitsplitPoint
- the explicit position to split on
-
splitRegionAsync
Description copied from interface:Admin
Split an individual region. Asynchronous operation.- Specified by:
splitRegionAsync
in interfaceAdmin
- Parameters:
regionName
- region to splitsplitPoint
- the explicit position to split on
-
modifyTableAsync
Description copied from interface:Admin
Modify an existing table, more IRB friendly version. Asynchronous operation. This means that it may be a while before your schema change is updated across all of the table. 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.- Specified by:
modifyTableAsync
in interfaceAdmin
- Parameters:
tableName
- name of table.td
- modified description of the table- Returns:
- the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the operation to complete
-
modifyTableAsync
Description copied from interface:Admin
Modify an existing table, more IRB (ruby) friendly version. Asynchronous operation. This means that it may be a while before your schema change is updated across all of the table. 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.- Specified by:
modifyTableAsync
in interfaceAdmin
- Parameters:
td
- description of the tablereopenRegions
- By default, 'modifyTableAsync' 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.- Returns:
- the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the operation to complete
-
shutdown
Description copied from interface:Admin
Shuts down the HBase cluster. Notice that, a success shutdown call may ends with an error since the remote server has already been shutdown. -
stopMaster
Description copied from interface:Admin
Shuts down the current HBase master only. Does not shutdown the cluster. Notice that, a success stopMaster call may ends with an error since the remote server has already been shutdown.- Specified by:
stopMaster
in interfaceAdmin
- See Also:
-
isMasterInMaintenanceMode
Description copied from interface:Admin
Check whether Master is in maintenance mode.- Specified by:
isMasterInMaintenanceMode
in interfaceAdmin
-
stopRegionServer
Description copied from interface:Admin
Stop the designated regionserver.- Specified by:
stopRegionServer
in interfaceAdmin
- Parameters:
hostnamePort
- Hostname and port delimited by a:
as inexample.org:1234
-
getClusterMetrics
Description copied from interface:Admin
Get cluster status with a set ofClusterMetrics.Option
to get desired status.- Specified by:
getClusterMetrics
in interfaceAdmin
- Returns:
- cluster status
-
getRegionMetrics
Description copied from interface:Admin
GetRegionMetrics
of all regions hosted on a regionserver for a table.- Specified by:
getRegionMetrics
in interfaceAdmin
- Parameters:
serverName
- region server from whichRegionMetrics
is required.tableName
- getRegionMetrics
of regions belonging to the table- Returns:
- region metrics map of all regions of a table hosted on a region server
-
createNamespaceAsync
Description copied from interface:Admin
Create a new namespace.- Specified by:
createNamespaceAsync
in interfaceAdmin
- Parameters:
descriptor
- descriptor which describes the new namespace- Returns:
- the result of the async create namespace operation. Use Future.get(long, TimeUnit) to wait on the operation to complete.
-
modifyNamespaceAsync
Description copied from interface:Admin
Modify an existing namespace.- Specified by:
modifyNamespaceAsync
in interfaceAdmin
- Parameters:
descriptor
- descriptor which describes the new namespace- Returns:
- the result of the async modify namespace operation. Use Future.get(long, TimeUnit) to wait on the operation to complete.
-
getTableRegions
Description copied from interface:Admin
Get the regions of a given table.- Specified by:
getTableRegions
in interfaceAdmin
- Parameters:
tableName
- the name of the table- Returns:
- List of
HRegionInfo
.
-
getRegions
Description copied from interface:Admin
Get the regions of a given table.- Specified by:
getRegions
in interfaceAdmin
- Parameters:
tableName
- the name of the table- Returns:
- List of
RegionInfo
.
-
abortProcedure
Description copied from interface:Admin
Abort a procedure. Do not use. Usually it is ignored but if not, it can do more damage than good. See hbck2.- Specified by:
abortProcedure
in interfaceAdmin
- Parameters:
procId
- ID of the procedure to abortmayInterruptIfRunning
- if the proc completed at least one step, should it be aborted?- Returns:
true
if aborted,false
if procedure already completed or does not exist- See Also:
-
abortProcedureAsync
Description copied from interface:Admin
Abort a procedure but does not block and wait for completion. 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. Do not use. Usually it is ignored but if not, it can do more damage than good. See hbck2.- Specified by:
abortProcedureAsync
in interfaceAdmin
- Parameters:
procId
- ID of the procedure to abortmayInterruptIfRunning
- if the proc completed at least one step, should it be aborted?- Returns:
true
if aborted,false
if procedure already completed or does not exist- See Also:
-
getProcedures
Description copied from interface:Admin
Get procedures.- Specified by:
getProcedures
in interfaceAdmin
- Returns:
- procedure list in JSON
-
getLocks
Description copied from interface:Admin
Get locks. -
rollWALWriter
Description copied from interface:Admin
Roll the log writer. I.e. for filesystem based write ahead logs, start writing to a new file. Note that the actual rolling of the log writer is asynchronous and may not be complete when this method returns. As a side effect of this call, the named region server may schedule store flushes at the request of the wal.- Specified by:
rollWALWriter
in interfaceAdmin
- Parameters:
serverName
- The servername of the regionserver.
-
getCompactionState
Description copied from interface:Admin
Get the current compaction state of a table. It could be in a major compaction, a minor compaction, both, or none.- Specified by:
getCompactionState
in interfaceAdmin
- Parameters:
tableName
- table to examine- Returns:
- the current compaction state
-
getCompactionState
Description copied from interface:Admin
Get the current compaction state of a table. It could be in a compaction, or none.- Specified by:
getCompactionState
in interfaceAdmin
- Parameters:
tableName
- table to examinecompactType
-CompactType
- Returns:
- the current compaction state
-
getCompactionStateForRegion
Description copied from interface:Admin
Get the current compaction state of region. It could be in a major compaction, a minor compaction, both, or none.- Specified by:
getCompactionStateForRegion
in interfaceAdmin
- Parameters:
regionName
- region to examine- Returns:
- the current compaction state
-
getLastMajorCompactionTimestamp
Description copied from interface:Admin
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.- Specified by:
getLastMajorCompactionTimestamp
in interfaceAdmin
- Parameters:
tableName
- table to examine- Returns:
- the last major compaction timestamp or 0
-
getLastMajorCompactionTimestampForRegion
Description copied from interface:Admin
Get the timestamp of the last major compaction for the passed region. The timestamp of the oldest HFile resulting from a major compaction of that region, or 0 if no such HFile could be found.- Specified by:
getLastMajorCompactionTimestampForRegion
in interfaceAdmin
- Parameters:
regionName
- region to examine- Returns:
- the last major compaction timestamp or 0
-
snapshot
Description copied from interface:Admin
Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be taken. If the table is disabled, an offline snapshot is taken. Snapshots are considered unique based on the name of the snapshot. Attempts to take a snapshot with the same name (even a different type or with different parameters) will fail with aSnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. SeeTableName.isLegalFullyQualifiedTableName(byte[])
. -
snapshot
Description copied from interface:Admin
Create a timestamp consistent snapshot for the given table. Snapshots are considered unique based on the name of the snapshot. Attempts to take a snapshot with the same name (even different type or with different parameters) will fail with aSnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. -
snapshot
Description copied from interface:Admin
Create typed snapshot of the table. Snapshots are considered unique based on the name of the snapshot. Attempts to take a snapshot with the same name (even a different type or with different parameters) will fail with aSnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. SeeTableName.isLegalFullyQualifiedTableName(byte[])
. -
snapshot
Description copied from interface:Admin
Take a snapshot and wait for the server to complete that snapshot (blocking). Snapshots are considered unique based on the name of the snapshot. Snapshots are taken sequentially even when requested concurrently, across all tables. Attempts to take a snapshot with the same name (even a different type or with different parameters) will fail with aSnapshotCreationException
indicating the duplicate naming. Snapshot names follow the same naming constraints as tables in HBase. SeeTableName.isLegalFullyQualifiedTableName(byte[])
. You should probably useAdmin.snapshot(String, org.apache.hadoop.hbase.TableName)
orAdmin.snapshot(byte[], org.apache.hadoop.hbase.TableName)
unless you are sure about the type of snapshot that you want to take. -
snapshotAsync
Description copied from interface:Admin
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.- Specified by:
snapshotAsync
in interfaceAdmin
- Parameters:
snapshot
- snapshot to take
-
isSnapshotFinished
Description copied from interface:Admin
Check the current state of the passed snapshot. There are three possible states:- running - returns false
- finished - returns true
- finished with error - throws the exception that caused the snapshot to fail
UnknownSnapshotException
.- Specified by:
isSnapshotFinished
in interfaceAdmin
- Parameters:
snapshot
- description of the snapshot to check- Returns:
- true if the snapshot is completed, false if the snapshot is still running
-
restoreSnapshot
Description copied from interface:Admin
Restore the specified snapshot on the original table. (The table must be disabled) If the "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set totrue
, 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.- Specified by:
restoreSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot to restore
-
restoreSnapshot
Description copied from interface:Admin
Restore the specified snapshot on the original table. (The table must be disabled) If the "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set totrue
, 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.- Specified by:
restoreSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot to restore
-
restoreSnapshotAsync
Description copied from interface:Admin
Restore the specified snapshot on the original table. (The table must be disabled) If the "hbase.snapshot.restore.take.failsafe.snapshot" configuration property is set totrue
, 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.- Specified by:
restoreSnapshotAsync
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot to restore- Returns:
- the result of the async restore snapshot. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
restoreSnapshot
Description copied from interface:Admin
Restore the specified snapshot on the original table. (The table must be disabled) If 'takeFailSafeSnapshot' is set totrue
, 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".- Specified by:
restoreSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot to restoretakeFailSafeSnapshot
-true
if the failsafe snapshot should be takenrestoreAcl
-true
to restore acl of snapshot
-
cloneSnapshotAsync
public Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean cloneAcl, String customSFT) throws IOException, TableExistsException, RestoreSnapshotException Description copied from interface:Admin
Create a new table by cloning the snapshot content.- Specified by:
cloneSnapshotAsync
in interfaceAdmin
- Parameters:
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 table- Throws:
IOException
- if a remote or network exception occursTableExistsException
- if table to be created already existsRestoreSnapshotException
- if snapshot failed to be cloned
-
execProcedure
Description copied from interface:Admin
Execute a distributed procedure on a cluster.- Specified by:
execProcedure
in interfaceAdmin
- Parameters:
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 procedure
-
execProcedureWithReturn
Description copied from interface:Admin
Execute a distributed procedure on a cluster.- Specified by:
execProcedureWithReturn
in interfaceAdmin
- Parameters:
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 procedure- Returns:
- data returned after procedure execution. null if no return data.
-
isProcedureFinished
Description copied from interface:Admin
Check the current state of the specified procedure. There are three possible states:- running - returns false
- finished - returns true
- finished with error - throws the exception that caused the procedure to fail
- Specified by:
isProcedureFinished
in interfaceAdmin
- Parameters:
signature
- The signature that uniquely identifies a procedureinstance
- The instance name of the procedureprops
- Property/Value pairs of properties passing to the procedure- Returns:
true
if the specified procedure is finished successfully,false
if it is still running
-
listSnapshots
Description copied from interface:Admin
List completed snapshots.- Specified by:
listSnapshots
in interfaceAdmin
- Returns:
- a list of snapshot descriptors for completed snapshots
-
listSnapshots
Description copied from interface:Admin
List all the completed snapshots matching the given regular expression.- Specified by:
listSnapshots
in interfaceAdmin
- Parameters:
regex
- The regular expression to match against- Returns:
- list of SnapshotDescription
-
listSnapshots
Description copied from interface:Admin
List all the completed snapshots matching the given pattern.- Specified by:
listSnapshots
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match against- Returns:
- list of SnapshotDescription
-
listTableSnapshots
public List<SnapshotDescription> listTableSnapshots(String tableNameRegex, String snapshotNameRegex) Description copied from interface:Admin
List all the completed snapshots matching the given table name regular expression and snapshot name regular expression.- Specified by:
listTableSnapshots
in interfaceAdmin
- Parameters:
tableNameRegex
- The table name regular expression to match againstsnapshotNameRegex
- The snapshot name regular expression to match against- Returns:
- list of completed SnapshotDescription
-
listTableSnapshots
public List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) Description copied from interface:Admin
List all the completed snapshots matching the given table name regular expression and snapshot name regular expression.- Specified by:
listTableSnapshots
in interfaceAdmin
- Parameters:
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match against- Returns:
- list of completed SnapshotDescription
-
deleteSnapshot
Description copied from interface:Admin
Delete an existing snapshot.- Specified by:
deleteSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot
-
deleteSnapshot
Description copied from interface:Admin
Delete an existing snapshot.- Specified by:
deleteSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- name of the snapshot
-
deleteSnapshots
Description copied from interface:Admin
Delete existing snapshots whose names match the pattern passed.- Specified by:
deleteSnapshots
in interfaceAdmin
- Parameters:
regex
- The regular expression to match against
-
deleteSnapshots
Description copied from interface:Admin
Delete existing snapshots whose names match the pattern passed.- Specified by:
deleteSnapshots
in interfaceAdmin
- Parameters:
pattern
- pattern for names of the snapshot to match
-
deleteTableSnapshots
Description copied from interface:Admin
Delete all existing snapshots matching the given table name regular expression and snapshot name regular expression.- Specified by:
deleteTableSnapshots
in interfaceAdmin
- Parameters:
tableNameRegex
- The table name regular expression to match againstsnapshotNameRegex
- The snapshot name regular expression to match against
-
deleteTableSnapshots
Description copied from interface:Admin
Delete all existing snapshots matching the given table name regular expression and snapshot name regular expression.- Specified by:
deleteTableSnapshots
in interfaceAdmin
- Parameters:
tableNamePattern
- The compiled table name regular expression to match againstsnapshotNamePattern
- The compiled snapshot name regular expression to match against
-
setQuota
Description copied from interface:Admin
Apply the new quota settings. -
getQuotaRetriever
Description copied from interface:Admin
Return a QuotaRetriever to list the quotas based on the filter.- Specified by:
getQuotaRetriever
in interfaceAdmin
- Parameters:
filter
- the quota settings filter- Returns:
- the quota retriever
-
getQuota
Description copied from interface:Admin
List the quotas based on the filter. -
coprocessorService
Description copied from interface:Admin
Creates and returns aRpcChannel
instance connected to the active master.The obtained
RpcChannel
instance can be used to access a published coprocessorService
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);
- Specified by:
coprocessorService
in interfaceAdmin
- Returns:
- A MasterCoprocessorRpcChannel instance
-
coprocessorService
Description copied from interface:Admin
Creates and returns aRpcChannel
instance connected to the passed region server.The obtained
RpcChannel
instance can be used to access a published coprocessorService
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);
- Specified by:
coprocessorService
in interfaceAdmin
- Parameters:
serverName
- the server name to which the endpoint call is made- Returns:
- A RegionServerCoprocessorRpcChannel instance
-
updateConfiguration
Description copied from interface:Admin
Update the configuration and trigger an online config change on the regionserver.- Specified by:
updateConfiguration
in interfaceAdmin
- Parameters:
server
- : The server whose config needs to be updated.
-
updateConfiguration
Description copied from interface:Admin
Update the configuration and trigger an online config change on all the regionservers.- Specified by:
updateConfiguration
in interfaceAdmin
-
getSecurityCapabilities
Description copied from interface:Admin
Return the set of supported security capabilities.- Specified by:
getSecurityCapabilities
in interfaceAdmin
-
splitSwitch
Description copied from interface:Admin
Turn the split switch on or off.- Specified by:
splitSwitch
in interfaceAdmin
- Parameters:
enabled
- enabled or notsynchronous
- Iftrue
, it waits until current split() call, if outstanding, to return.- Returns:
- Previous switch value
-
mergeSwitch
Description copied from interface:Admin
Turn the merge switch on or off.- Specified by:
mergeSwitch
in interfaceAdmin
- Parameters:
enabled
- enabled or notsynchronous
- Iftrue
, it waits until current merge() call, if outstanding, to return.- Returns:
- Previous switch value
-
isSplitEnabled
Description copied from interface:Admin
Query the current state of the split switch.- Specified by:
isSplitEnabled
in interfaceAdmin
- Returns:
true
if the switch is enabled,false
otherwise.
-
isMergeEnabled
Description copied from interface:Admin
Query the current state of the merge switch.- Specified by:
isMergeEnabled
in interfaceAdmin
- Returns:
true
if the switch is enabled,false
otherwise.
-
addReplicationPeerAsync
public Future<Void> addReplicationPeerAsync(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) Description copied from interface:Admin
Add a new replication peer but does not block and wait for it.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.
- Specified by:
addReplicationPeerAsync
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peerpeerConfig
- configuration for the replication peerenabled
- peer state, true if ENABLED and false if DISABLED- Returns:
- the result of the async operation
-
removeReplicationPeerAsync
Description copied from interface:Admin
Remove a replication peer but does not block and wait for it.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.
- Specified by:
removeReplicationPeerAsync
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peer- Returns:
- the result of the async operation
-
enableReplicationPeerAsync
Description copied from interface:Admin
Enable a replication peer but does not block and wait for it.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.
- Specified by:
enableReplicationPeerAsync
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peer- Returns:
- the result of the async operation
-
disableReplicationPeerAsync
Description copied from interface:Admin
Disable a replication peer but does not block and wait for it. 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.- Specified by:
disableReplicationPeerAsync
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peer- Returns:
- the result of the async operation
-
getReplicationPeerConfig
Description copied from interface:Admin
Returns the configured ReplicationPeerConfig for the specified peer.- Specified by:
getReplicationPeerConfig
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peer- Returns:
- ReplicationPeerConfig for the peer
-
updateReplicationPeerConfigAsync
public Future<Void> updateReplicationPeerConfigAsync(String peerId, ReplicationPeerConfig peerConfig) Description copied from interface:Admin
Update the peerConfig for the specified peer but does not block and wait for it. 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.- Specified by:
updateReplicationPeerConfigAsync
in interfaceAdmin
- Parameters:
peerId
- a short name that identifies the peerpeerConfig
- new config for the replication peer- Returns:
- the result of the async operation
-
listReplicationPeers
Description copied from interface:Admin
Return a list of replication peers.- Specified by:
listReplicationPeers
in interfaceAdmin
- Returns:
- a list of replication peers description
-
listReplicationPeers
Description copied from interface:Admin
Return a list of replication peers.- Specified by:
listReplicationPeers
in interfaceAdmin
- Parameters:
pattern
- The compiled regular expression to match peer id- Returns:
- a list of replication peers description
-
decommissionRegionServers
Description copied from interface:Admin
Mark region server(s) as decommissioned to prevent additional regions from getting assigned to them. Optionally unload the regions on the servers. If there are multiple servers to be decommissioned, decommissioning them at the same time can prevent wasteful region movements. Region unloading is asynchronous.- Specified by:
decommissionRegionServers
in interfaceAdmin
- Parameters:
servers
- The list of servers to decommission.offload
- True to offload the regions from the decommissioned servers
-
listDecommissionedRegionServers
Description copied from interface:Admin
List region servers marked as decommissioned, which can not be assigned regions.- Specified by:
listDecommissionedRegionServers
in interfaceAdmin
- Returns:
- List of decommissioned region servers.
-
recommissionRegionServer
Description copied from interface:Admin
Remove decommission marker from a region server to allow regions assignments. Load regions onto the server if a list of regions is given. Region loading is asynchronous.- Specified by:
recommissionRegionServer
in interfaceAdmin
- Parameters:
server
- The server to recommission.encodedRegionNames
- Regions to load onto the server.
-
listReplicatedTableCFs
Description copied from interface:Admin
Find all table and column families that are replicated from this cluster- Specified by:
listReplicatedTableCFs
in interfaceAdmin
- Returns:
- the replicated table-cfs list of this cluster.
-
enableTableReplication
Description copied from interface:Admin
Enable a table's replication switch.- Specified by:
enableTableReplication
in interfaceAdmin
- Parameters:
tableName
- name of the table
-
disableTableReplication
Description copied from interface:Admin
Disable a table's replication switch.- Specified by:
disableTableReplication
in interfaceAdmin
- Parameters:
tableName
- name of the table
-
isReplicationPeerEnabled
Description copied from interface:Admin
Check if a replication peer is enabled.- Specified by:
isReplicationPeerEnabled
in interfaceAdmin
- Parameters:
peerId
- id of replication peer to check- Returns:
true
if replication peer is enabled- Throws:
IOException
- if a remote or network exception occurs
-
clearCompactionQueues
Description copied from interface:Admin
Clear compacting queues on a regionserver.- Specified by:
clearCompactionQueues
in interfaceAdmin
- Parameters:
serverName
- the region server namequeues
- the set of queue name
-
clearDeadServers
Description copied from interface:Admin
Clear dead region servers from master.- Specified by:
clearDeadServers
in interfaceAdmin
- Parameters:
servers
- list of dead region servers.- Returns:
- List of servers that are not cleared
-
cloneTableSchema
Description copied from interface:Admin
Create a new table by cloning the existent table schema.- Specified by:
cloneTableSchema
in interfaceAdmin
- Parameters:
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 preserved
-
createTableAsync
Description copied from interface:Admin
Creates a new table but does not block and wait for it to come online. 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. Throws IllegalArgumentException Bad table name, if the split keys are repeated and if the split key has empty byte array.- Specified by:
createTableAsync
in interfaceAdmin
- Parameters:
desc
- table descriptor for table- Returns:
- the result of the async creation. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
createTableAsync
Description copied from interface:Admin
Creates a new table but does not block and wait for it to come online. 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. Throws IllegalArgumentException Bad table name, if the split keys are repeated and if the split key has empty byte array.- Specified by:
createTableAsync
in interfaceAdmin
- Parameters:
desc
- table descriptor for tablesplitKeys
- keys to check if the table has been created with all split keys- Returns:
- the result of the async creation. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
deleteTableAsync
Description copied from interface:Admin
Deletes the table but does not block and wait for it to be completely removed. 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.- Specified by:
deleteTableAsync
in interfaceAdmin
- Parameters:
tableName
- name of table to delete- Returns:
- the result of the async delete. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
truncateTableAsync
Description copied from interface:Admin
Truncate the table but does not block and wait for it to be completely enabled. 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.- Specified by:
truncateTableAsync
in interfaceAdmin
- Parameters:
tableName
- name of table to deletepreserveSplits
-true
if the splits should be preserved- Returns:
- the result of the async truncate. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
enableTableAsync
Description copied from interface:Admin
Enable the table but does not block and wait for it to be completely enabled. 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.- Specified by:
enableTableAsync
in interfaceAdmin
- Parameters:
tableName
- name of table to delete- Returns:
- the result of the async enable. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
disableTableAsync
Description copied from interface:Admin
Disable the table but does not block and wait for it to be completely disabled. 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.- Specified by:
disableTableAsync
in interfaceAdmin
- Parameters:
tableName
- name of table to delete- Returns:
- the result of the async disable. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
flushAsync
Description copied from interface:Admin
Flush a table but does not block and wait for it to finish. 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.- Specified by:
flushAsync
in interfaceAdmin
- Parameters:
tableName
- table to flushcolumnFamilies
- column families within a table- Returns:
- the result of the async creation. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
getAlterStatus
Description copied from interface:Admin
Get the status of analter
(a.k.amodify
) command - indicates how many regions have received the updated schema Asynchronous operation.- Specified by:
getAlterStatus
in interfaceAdmin
- Parameters:
tableName
- TableName instance- Returns:
- Pair indicating the number of regions updated Pair.getFirst() is the regions that are yet to be updated Pair.getSecond() is the total number of regions of the table
-
getAlterStatus
Description copied from interface:Admin
Get the status ofalter
(a.k.amodify
) command - indicates how many regions have received the updated schema Asynchronous operation.- Specified by:
getAlterStatus
in interfaceAdmin
- Parameters:
tableName
- name of the table to get the status of- Returns:
- Pair indicating the number of regions updated Pair.getFirst() is the regions that are yet to be updated Pair.getSecond() is the total number of regions of the table
-
deleteColumnFamilyAsync
Description copied from interface:Admin
Delete a column family from a table. Asynchronous operation. 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.- Specified by:
deleteColumnFamilyAsync
in interfaceAdmin
- Parameters:
tableName
- name of tablecolumnFamily
- name of column family to be deleted- Returns:
- the result of the async delete column family. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
addColumnFamilyAsync
Description copied from interface:Admin
Add a column family to an existing table. Asynchronous operation. 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.- Specified by:
addColumnFamilyAsync
in interfaceAdmin
- Parameters:
tableName
- name of the table to add column family tocolumnFamily
- column family descriptor of column family to be added- Returns:
- the result of the async add column family. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
modifyColumnFamilyAsync
public Future<Void> modifyColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) Description copied from interface:Admin
Modify an existing column family on a table. Asynchronous operation. 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.- Specified by:
modifyColumnFamilyAsync
in interfaceAdmin
- Parameters:
tableName
- name of tablecolumnFamily
- new column family descriptor to use- Returns:
- the result of the async modify column family. You can use Future.get(long, TimeUnit) to wait on the operation to complete.
-
deleteNamespaceAsync
Description copied from interface:Admin
Delete an existing namespace. Only empty namespaces (no tables) can be removed.- Specified by:
deleteNamespaceAsync
in interfaceAdmin
- Parameters:
name
- namespace name- Returns:
- the result of the async delete namespace operation. Use Future.get(long, TimeUnit) to wait on the operation to complete.
-
getSpaceQuotaTableSizes
Description copied from interface:Admin
Fetches the table sizes on the filesystem as tracked by the HBase Master.- Specified by:
getSpaceQuotaTableSizes
in interfaceAdmin
- Throws:
IOException
- if a remote or network exception occurs
-
getRegionServerSpaceQuotaSnapshots
public Map<TableName,SpaceQuotaSnapshot> getRegionServerSpaceQuotaSnapshots(ServerName serverName) throws IOException Description copied from interface:Admin
Fetches the observedSpaceQuotaSnapshotView
s observed by a RegionServer.- Specified by:
getRegionServerSpaceQuotaSnapshots
in interfaceAdmin
- Throws:
IOException
- if a remote or network exception occurs
-
getCurrentSpaceQuotaSnapshot
Description copied from interface:Admin
Returns the Master's view of a quota on the givennamespace
or null if the Master has no quota information on that namespace.- Specified by:
getCurrentSpaceQuotaSnapshot
in interfaceAdmin
- Throws:
IOException
- if a remote or network exception occurs
-
getCurrentSpaceQuotaSnapshot
Description copied from interface:Admin
Returns the Master's view of a quota on the giventableName
or null if the Master has no quota information on that table.- Specified by:
getCurrentSpaceQuotaSnapshot
in interfaceAdmin
- Throws:
IOException
- if a remote or network exception occurs
-
grant
Description copied from interface:Admin
Grants user specific permissions -
revoke
Description copied from interface:Admin
Revokes user specific permissions -
getUserPermissions
Description copied from interface:Admin
Get the global/namespace/table permissions for user- Specified by:
getUserPermissions
in interfaceAdmin
- Parameters:
getUserPermissionsRequest
- A request contains which user, global, namespace or table permissions needed- Returns:
- The user and permission list
-
hasUserPermissions
Description copied from interface:Admin
Check if the user has specific permissions- Specified by:
hasUserPermissions
in interfaceAdmin
- Parameters:
userName
- the user namepermissions
- the specific permission list- Returns:
- True if user has the specific permissions
-
snapshotCleanupSwitch
Description copied from interface:Admin
Turn on or off the auto snapshot cleanup based on TTL.- Specified by:
snapshotCleanupSwitch
in interfaceAdmin
- Parameters:
on
- Set totrue
to enable,false
to disable.synchronous
- Iftrue
, it waits until current snapshot cleanup is completed, if outstanding.- Returns:
- Previous auto snapshot cleanup value
-
isSnapshotCleanupEnabled
Description copied from interface:Admin
Query the current state of the auto snapshot cleanup based on TTL.- Specified by:
isSnapshotCleanupEnabled
in interfaceAdmin
- Returns:
true
if the auto snapshot cleanup is enabled,false
otherwise.
-
getSlowLogResponses
public List<OnlineLogRecord> getSlowLogResponses(Set<ServerName> serverNames, LogQueryFilter logQueryFilter) throws IOException Description copied from interface:Admin
Retrieves online slow/large RPC logs from the provided list of RegionServers- Specified by:
getSlowLogResponses
in interfaceAdmin
- Parameters:
serverNames
- Server names to get slowlog responses fromlogQueryFilter
- filter to be used if provided (determines slow / large RPC logs)- Returns:
- online slowlog response list
- Throws:
IOException
- if a remote or network exception occurs
-
clearSlowLogResponses
Description copied from interface:Admin
Clears online slow/large RPC logs from the provided list of RegionServers- Specified by:
clearSlowLogResponses
in interfaceAdmin
- Parameters:
serverNames
- Set of Server names to clean slowlog responses from- Returns:
- List of booleans representing if online slowlog response buffer is cleaned from each RegionServer
- Throws:
IOException
- if a remote or network exception occurs
-
splitRegionAsync
Description copied from interface:Admin
Split an individual region. Asynchronous operation.- Specified by:
splitRegionAsync
in interfaceAdmin
- Parameters:
regionName
- region to split- Throws:
IOException
- if a remote or network exception occurs
-
getLogEntries
public List<LogEntry> getLogEntries(Set<ServerName> serverNames, String logType, ServerType serverType, int limit, Map<String, Object> filterParams) throws IOExceptionDescription copied from interface:Admin
Retrieve recent online records from HMaster / RegionServers. Examples include slow/large RPC logs, balancer decisions by master.- Specified by:
getLogEntries
in interfaceAdmin
- Parameters:
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 params- Returns:
- Log entries representing online records from servers
- Throws:
IOException
- if a remote or network exception occurs
-
flushMasterStore
Description copied from interface:Admin
Flush master local region- Specified by:
flushMasterStore
in interfaceAdmin
- Throws:
IOException
-
modifyColumnFamilyStoreFileTrackerAsync
public Future<Void> modifyColumnFamilyStoreFileTrackerAsync(TableName tableName, byte[] family, String dstSFT) throws IOException Description copied from interface:Admin
Change the store file tracker of the given table's given family.- Specified by:
modifyColumnFamilyStoreFileTrackerAsync
in interfaceAdmin
- Parameters:
tableName
- the table you want to changefamily
- the family you want to changedstSFT
- the destination store file tracker- Returns:
- the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the operation to complete
- Throws:
IOException
- if a remote or network exception occurs
-
modifyTableStoreFileTrackerAsync
public Future<Void> modifyTableStoreFileTrackerAsync(TableName tableName, String dstSFT) throws IOException Description copied from interface:Admin
Change the store file tracker of the given table.- Specified by:
modifyTableStoreFileTrackerAsync
in interfaceAdmin
- Parameters:
tableName
- the table you want to changedstSFT
- the destination store file tracker- Returns:
- the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the operation to complete
- Throws:
IOException
- if a remote or network exception occurs
-
replicationPeerModificationSwitch
public boolean replicationPeerModificationSwitch(boolean on, boolean drainProcedures) throws IOException Description copied from interface:Admin
Enable or disable replication peer modification. This is especially useful when you want to change the replication peer storage.- Specified by:
replicationPeerModificationSwitch
in interfaceAdmin
- Parameters:
on
-true
means enable, otherwise disabledrainProcedures
- iftrue
, will wait until all the running replication peer modification procedures finish- Returns:
- the previous enable/disable state
- Throws:
IOException
-
flush
Description copied from interface:Admin
Flush the specified column family stores on all regions of the passed table. This runs as a synchronous operation. -
isReplicationPeerModificationEnabled
Description copied from interface:Admin
Check whether replication peer modification is enabled.- Specified by:
isReplicationPeerModificationEnabled
in interfaceAdmin
- Returns:
true
if modification is enabled, otherwisefalse
- Throws:
IOException
-