Class AbstractBigtableAdmin
- java.lang.Object
-
- org.apache.hadoop.hbase.client.AbstractBigtableAdmin
-
- All Implemented Interfaces:
- Closeable, AutoCloseable, Abortable, Admin
- Direct Known Subclasses:
- BigtableAdmin, BigtableAdmin
public abstract class AbstractBigtableAdmin extends Object implements Admin
Abstract AbstractBigtableAdmin class.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description protected BigtableInstanceName
bigtableInstanceName
protected CommonConnection
connection
protected Logger
LOG
protected TableAdapter
tableAdapter
protected IBigtableTableAdminClient
tableAdminClientWrapper
-
Constructor Summary
Constructors Constructor and Description AbstractBigtableAdmin(CommonConnection connection)
Constructor for AbstractBigtableAdmin.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description void
abort(String why, Throwable e)
void
addColumn(String tableName, HColumnDescriptor column)
Deprecated.void
addColumn(TableName tableName, HColumnDescriptor column)
void
assign(byte[] regionName)
boolean
balancer()
void
cloneSnapshot(byte[] snapshotName, byte[] tableName)
This is needed for the hbase shell.void
cloneSnapshot(byte[] snapshotName, TableName tableName)
void
cloneSnapshot(String snapshotName, TableName tableName)
void
close()
void
closeRegion(byte[] regionname, String serverName)
void
closeRegion(ServerName sn, HRegionInfo hri)
void
closeRegion(String regionname, String serverName)
boolean
closeRegionWithEncodedRegionName(String encodedRegionName, String serverName)
void
compact(TableName tableName)
void
compact(TableName tableName, byte[] bytes)
void
compactRegion(byte[] bytes)
void
compactRegion(byte[] bytes, byte[] bytes2)
void
compactRegionServer(ServerName serverName, boolean b)
static IOException
convertToTableExistsException(TableName tableName, Throwable throwable)
CoprocessorRpcChannel
coprocessorService()
CoprocessorRpcChannel
coprocessorService(ServerName serverName)
void
createNamespace(NamespaceDescriptor descriptor)
static byte[][]
createSplitKeys(byte[] startKey, byte[] endKey, int numRegions)
void
createTable(HTableDescriptor desc)
void
createTable(HTableDescriptor desc, byte[][] splitKeys)
void
createTable(HTableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions)
protected void
createTable(TableName tableName, com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request)
Creates a Table.void
createTableAsync(HTableDescriptor desc, byte[][] splitKeys)
protected ListenableFuture<com.google.cloud.bigtable.admin.v2.models.Table>
createTableAsync(TableName tableName, com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request)
void
deleteColumn(String tableName, byte[] columnName)
Deprecated.void
deleteColumn(String tableName, String columnName)
Deprecated.void
deleteColumn(TableName tableName, byte[] columnName)
void
deleteNamespace(String name)
void
deleteRowRangeByPrefix(TableName tableName, byte[] prefix)
deleteRowRangeByPrefix.void
deleteSnapshot(byte[] snapshotName)
void
deleteSnapshot(String snapshotName)
void
deleteSnapshots(Pattern pattern)
void
deleteSnapshots(String regex)
void
deleteTable(TableName tableName)
HTableDescriptor[]
deleteTables(Pattern pattern)
HTableDescriptor[]
deleteTables(String regex)
void
deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern)
void
deleteTableSnapshots(String tableNameRegex, String snapshotNameRegex)
void
disableTable(String tableName)
Deprecated.void
disableTable(TableName tableName)
HTableDescriptor[]
disableTables(Pattern pattern)
HTableDescriptor[]
disableTables(String regex)
boolean
enableCatalogJanitor(boolean enable)
void
enableTable(String tableName)
Deprecated.void
enableTable(TableName tableName)
HTableDescriptor[]
enableTables(Pattern pattern)
HTableDescriptor[]
enableTables(String regex)
void
execProcedure(String signature, String instance, Map<String,String> props)
byte[]
execProcedureWithRet(String signature, String instance, Map<String,String> props)
void
flush(TableName tableName)
void
flushRegion(byte[] bytes)
Pair<Integer,Integer>
getAlterStatus(byte[] tableName)
Pair<Integer,Integer>
getAlterStatus(String tableName)
getAlterStatus.Pair<Integer,Integer>
getAlterStatus(TableName tableName)
protected BigtableClusterName
getClusterName()
ClusterStatus
getClusterStatus()
org.apache.hadoop.conf.Configuration
getConfiguration()
Connection
getConnection()
String[]
getMasterCoprocessors()
int
getMasterInfoPort()
NamespaceDescriptor
getNamespaceDescriptor(String name)
List<HRegionInfo>
getOnlineRegions(ServerName sn)
int
getOperationTimeout()
protected BigtableClusterName
getSnapshotClusterName()
HTableDescriptor
getTableDescriptor(TableName tableName)
HTableDescriptor[]
getTableDescriptors(List<String> names)
HTableDescriptor[]
getTableDescriptorsByTableName(List<TableName> tableNames)
String[]
getTableNames(String regex)
Deprecated.List<HRegionInfo>
getTableRegions(TableName tableName)
boolean
isAborted()
boolean
isCatalogJanitorEnabled()
boolean
isProcedureFinished(String signature, String instance, Map<String,String> props)
boolean
isTableAvailable(TableName tableName)
boolean
isTableAvailable(TableName tableName, byte[][] splitKeys)
boolean
isTableDisabled(String tableName)
Deprecated.boolean
isTableDisabled(TableName tableName)
boolean
isTableEnabled(String tableName)
Deprecated.boolean
isTableEnabled(TableName tableName)
NamespaceDescriptor[]
listNamespaceDescriptors()
HTableDescriptor[]
listTableDescriptorsByNamespace(String name)
TableName[]
listTableNames()
Lists all table names for the cluster provided in the configuration.TableName[]
listTableNames(Pattern pattern)
TableName[]
listTableNames(Pattern pattern, boolean includeSysTables)
TableName[]
listTableNames(String patternStr)
Deprecated.TableName[]
listTableNames(String regex, boolean includeSysTables)
TableName[]
listTableNamesByNamespace(String name)
HTableDescriptor[]
listTables()
HTableDescriptor[]
listTables(Pattern pattern)
HTableDescriptor[]
listTables(Pattern pattern, boolean includeSysTables)
HTableDescriptor[]
listTables(String regex)
HTableDescriptor[]
listTables(String regex, boolean includeSysTables)
void
majorCompact(TableName tableName)
void
majorCompact(TableName tableName, byte[] bytes)
void
majorCompactRegion(byte[] bytes)
void
majorCompactRegion(byte[] bytes, byte[] bytes2)
void
mergeRegions(byte[] encodedNameOfRegionA, byte[] encodedNameOfRegionB, boolean forcible)
void
modifyColumn(TableName tableName, HColumnDescriptor column)
void
modifyColumns(String tableName, HColumnDescriptor descriptor)
Modify an existing column family on a table.protected Void
modifyColumns(TableName tableName, String columnName, String modificationType, ModifyTableBuilder builder)
modifyColumns.void
modifyNamespace(NamespaceDescriptor descriptor)
void
modifyTable(TableName tableName, HTableDescriptor newDescriptor)
void
move(byte[] encodedRegionName, byte[] destServerName)
void
offline(byte[] regionName)
void
restoreSnapshot(byte[] snapshotName)
void
restoreSnapshot(byte[] snapshotName, boolean takeFailSafeSnapshot)
void
restoreSnapshot(String snapshotName)
void
restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot)
void
rollWALWriter(ServerName serverName)
int
runCatalogScan()
boolean
setBalancerRunning(boolean on, boolean synchronous)
void
shutdown()
void
snapshot(byte[] snapshotName, byte[] tableName)
This is needed for the hbase shell.void
snapshot(byte[] snapshotName, TableName tableName)
void
snapshot(String snapshotName, TableName tableName)
Creates a snapshot from an existing table.protected com.google.longrunning.Operation
snapshotTable(String snapshotName, TableName tableName)
Creates a snapshot from an existing table.void
split(TableName tableName)
void
split(TableName tableName, byte[] bytes)
void
splitRegion(byte[] bytes)
void
splitRegion(byte[] bytes, byte[] bytes2)
void
stopMaster()
void
stopRegionServer(String hostnamePort)
boolean
tableExists(String tableName)
Deprecated.boolean
tableExists(TableName tableName)
String
toString()
void
truncateTable(TableName tableName, boolean preserveSplits)
void
unassign(byte[] regionName, boolean force)
void
updateConfiguration()
void
updateConfiguration(ServerName serverName)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hadoop.hbase.client.Admin
abortProcedure, abortProcedureAsync, addColumn, addColumnFamily, addColumnFamilyAsync, addReplicationPeer, addReplicationPeer, addReplicationPeerAsync, addReplicationPeerAsync, appendReplicationPeerTableCFs, balance, balance, balancer, balancerSwitch, catalogJanitorSwitch, cleanerChoreSwitch, clearBlockCache, clearCompactionQueues, clearDeadServers, cloneSnapshot, cloneSnapshotAsync, cloneTableSchema, compact, compact, compactRegionServer, createNamespaceAsync, createTable, createTable, createTable, createTableAsync, decommissionRegionServers, deleteColumnFamily, deleteColumnFamilyAsync, deleteNamespaceAsync, deleteTableAsync, disableReplicationPeer, disableReplicationPeerAsync, disableTableAsync, disableTableReplication, enableReplicationPeer, enableReplicationPeerAsync, enableTableAsync, enableTableReplication, execProcedureWithReturn, flushRegionServer, getBackupMasters, getClusterMetrics, getClusterMetrics, getCompactionState, getCompactionState, getCompactionStateForRegion, getDescriptor, getLastMajorCompactionTimestamp, getLastMajorCompactionTimestampForRegion, getLocks, getMaster, getMasterCoprocessorNames, getProcedures, getQuota, getQuotaRetriever, getRegionMetrics, getRegionMetrics, getRegions, getRegions, getRegionServers, getReplicationPeerConfig, getSecurityCapabilities, isBalancerEnabled, isCleanerChoreEnabled, isMasterInMaintenanceMode, isMergeEnabled, isNormalizerEnabled, isSnapshotFinished, isSplitEnabled, isSplitOrMergeEnabled, listDeadServers, listDecommissionedRegionServers, listReplicatedTableCFs, listReplicationPeers, listReplicationPeers, listSnapshots, listSnapshots, listSnapshots, listTableDescriptors, listTableDescriptors, listTableDescriptors, listTableDescriptors, listTableDescriptorsByNamespace, listTableSnapshots, listTableSnapshots, majorCompact, majorCompact, majorCompactRegionServer, mergeRegionsAsync, mergeRegionsAsync, mergeSwitch, modifyColumn, modifyColumnFamily, modifyColumnFamilyAsync, modifyNamespaceAsync, modifyTable, modifyTable, modifyTableAsync, modifyTableAsync, normalize, normalizerSwitch, recommissionRegionServer, removeReplicationPeer, removeReplicationPeerAsync, removeReplicationPeerTableCFs, restoreSnapshot, restoreSnapshotAsync, runCatalogJanitor, runCleanerChore, setCleanerChoreRunning, setNormalizerRunning, setQuota, setSplitOrMergeEnabled, snapshot, snapshot, snapshotAsync, splitRegionAsync, splitSwitch, takeSnapshotAsync, truncateTableAsync, updateReplicationPeerConfig, updateReplicationPeerConfigAsync
-
-
-
-
Field Detail
-
LOG
protected final Logger LOG
-
connection
protected final CommonConnection connection
-
tableAdminClientWrapper
protected final IBigtableTableAdminClient tableAdminClientWrapper
-
bigtableInstanceName
protected final BigtableInstanceName bigtableInstanceName
-
tableAdapter
protected final TableAdapter tableAdapter
-
-
Constructor Detail
-
AbstractBigtableAdmin
public AbstractBigtableAdmin(CommonConnection connection) throws IOException
Constructor for AbstractBigtableAdmin.- Parameters:
connection
- aCommonConnection
object.- Throws:
IOException
- if any.
-
-
Method Detail
-
getConnection
public Connection getConnection()
- Specified by:
getConnection
in interfaceAdmin
-
tableExists
public boolean tableExists(TableName tableName) throws IOException
- Specified by:
tableExists
in interfaceAdmin
- Throws:
IOException
-
tableExists
@Deprecated public boolean tableExists(String tableName) throws IOException
Deprecated.tableExists.- Parameters:
tableName
- aString
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
listTables
public HTableDescriptor[] listTables() throws IOException
- Specified by:
listTables
in interfaceAdmin
- Throws:
IOException
-
listTables
public HTableDescriptor[] listTables(Pattern pattern) throws IOException
- Specified by:
listTables
in interfaceAdmin
- Throws:
IOException
-
listTables
public HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables) throws IOException
- Specified by:
listTables
in interfaceAdmin
- Throws:
IOException
-
listTableNames
@Deprecated public TableName[] listTableNames(String patternStr) throws IOException
Deprecated.- Specified by:
listTableNames
in interfaceAdmin
- Throws:
IOException
-
listTableNames
public TableName[] listTableNames(Pattern pattern) throws IOException
- Specified by:
listTableNames
in interfaceAdmin
- Throws:
IOException
-
listTableNames
public TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException
- Specified by:
listTableNames
in interfaceAdmin
- Throws:
IOException
-
listTableNames
public TableName[] listTableNames(String regex, boolean includeSysTables) throws IOException
- Specified by:
listTableNames
in interfaceAdmin
- Throws:
IOException
-
listTables
public HTableDescriptor[] listTables(String regex) throws IOException
- Specified by:
listTables
in interfaceAdmin
- Throws:
IOException
-
listTables
public HTableDescriptor[] listTables(String regex, boolean includeSysTables) throws IOException
- Specified by:
listTables
in interfaceAdmin
- Throws:
IOException
-
listTableNames
public TableName[] listTableNames() throws IOException
Lists all table names for the cluster provided in the configuration.- Specified by:
listTableNames
in interfaceAdmin
- Throws:
IOException
-
getTableDescriptor
public HTableDescriptor getTableDescriptor(TableName tableName) throws IOException
- Specified by:
getTableDescriptor
in interfaceAdmin
- Throws:
IOException
-
getTableNames
@Deprecated public String[] getTableNames(String regex) throws IOException
Deprecated.getTableNames.- Parameters:
regex
- aString
object.- Returns:
- an array of
String
objects. - Throws:
IOException
- if any.
-
createTable
public void createTable(HTableDescriptor desc) throws IOException
- Throws:
IOException
-
createTable
public void createTable(HTableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) throws IOException
- Throws:
IOException
-
createSplitKeys
public static byte[][] createSplitKeys(byte[] startKey, byte[] endKey, int numRegions)
-
createTable
public void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException
- Throws:
IOException
-
createTable
protected void createTable(TableName tableName, com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request) throws IOException
Creates a Table.- Parameters:
tableName
- aTableName
object.request
- aCreateTableRequest
object to send.- Throws:
IOException
- if any.
-
createTableAsync
public void createTableAsync(HTableDescriptor desc, byte[][] splitKeys) throws IOException
- Throws:
IOException
-
createTableAsync
protected ListenableFuture<com.google.cloud.bigtable.admin.v2.models.Table> createTableAsync(TableName tableName, com.google.cloud.bigtable.admin.v2.models.CreateTableRequest request) throws IOException
- Parameters:
tableName
- aTableName
object for exception identification.request
- aCreateTableRequest
object to send.- Returns:
- a
ListenableFuture
object. - Throws:
IOException
- if any.
-
convertToTableExistsException
public static IOException convertToTableExistsException(TableName tableName, Throwable throwable)
-
deleteTable
public void deleteTable(TableName tableName) throws IOException
- Specified by:
deleteTable
in interfaceAdmin
- Throws:
IOException
-
deleteTables
public HTableDescriptor[] deleteTables(String regex) throws IOException
- Specified by:
deleteTables
in interfaceAdmin
- Throws:
IOException
-
deleteTables
public HTableDescriptor[] deleteTables(Pattern pattern) throws IOException
- Specified by:
deleteTables
in interfaceAdmin
- Throws:
IOException
-
enableTable
public void enableTable(TableName tableName) throws IOException
- Specified by:
enableTable
in interfaceAdmin
- Throws:
IOException
-
enableTable
@Deprecated public void enableTable(String tableName) throws IOException
Deprecated.enableTable.- Parameters:
tableName
- aString
object.- Throws:
IOException
- if any.
-
enableTables
public HTableDescriptor[] enableTables(String regex) throws IOException
- Specified by:
enableTables
in interfaceAdmin
- Throws:
IOException
-
enableTables
public HTableDescriptor[] enableTables(Pattern pattern) throws IOException
- Specified by:
enableTables
in interfaceAdmin
- Throws:
IOException
-
disableTable
public void disableTable(TableName tableName) throws IOException
- Specified by:
disableTable
in interfaceAdmin
- Throws:
IOException
-
disableTable
@Deprecated public void disableTable(String tableName) throws IOException
Deprecated.disableTable.- Parameters:
tableName
- aString
object.- Throws:
IOException
- if any.
-
disableTables
public HTableDescriptor[] disableTables(String regex) throws IOException
- Specified by:
disableTables
in interfaceAdmin
- Throws:
IOException
-
disableTables
public HTableDescriptor[] disableTables(Pattern pattern) throws IOException
- Specified by:
disableTables
in interfaceAdmin
- Throws:
IOException
-
isTableEnabled
public boolean isTableEnabled(TableName tableName) throws IOException
- Specified by:
isTableEnabled
in interfaceAdmin
- Throws:
IOException
-
isTableEnabled
@Deprecated public boolean isTableEnabled(String tableName) throws IOException
Deprecated.isTableEnabled.- Parameters:
tableName
- aString
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
isTableDisabled
public boolean isTableDisabled(TableName tableName) throws IOException
- Specified by:
isTableDisabled
in interfaceAdmin
- Throws:
IOException
-
isTableDisabled
@Deprecated public boolean isTableDisabled(String tableName) throws IOException
Deprecated.isTableDisabled.- Parameters:
tableName
- aString
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
isTableAvailable
public boolean isTableAvailable(TableName tableName) throws IOException
- Specified by:
isTableAvailable
in interfaceAdmin
- Throws:
IOException
-
addColumn
public void addColumn(TableName tableName, HColumnDescriptor column) throws IOException
- Throws:
IOException
-
modifyColumn
public void modifyColumn(TableName tableName, HColumnDescriptor column) throws IOException
- Throws:
IOException
-
deleteColumn
public void deleteColumn(TableName tableName, byte[] columnName) throws IOException
- Specified by:
deleteColumn
in interfaceAdmin
- Throws:
IOException
-
modifyTable
public void modifyTable(TableName tableName, HTableDescriptor newDescriptor) throws IOException
- Throws:
IOException
-
modifyColumns
protected Void modifyColumns(TableName tableName, String columnName, String modificationType, ModifyTableBuilder builder) throws IOException
modifyColumns.- Parameters:
tableName
- aTableName
object for error messages.columnName
- aString
object for error messagesmodificationType
- aString
object for error messagesbuilder
- aModifyTableBuilder
object to send.- Throws:
IOException
- if any.
-
addColumn
@Deprecated public void addColumn(String tableName, HColumnDescriptor column) throws IOException
Deprecated.- Throws:
IOException
-
modifyColumns
public void modifyColumns(String tableName, HColumnDescriptor descriptor) throws IOException
Modify an existing column family on a table. NOTE: this is needed for backwards compatibility for the hbase shell.- Parameters:
tableName
- aTableName
object.descriptor
- aHColumnDescriptor
object.- Throws:
IOException
- if any.
-
deleteColumn
@Deprecated public void deleteColumn(String tableName, byte[] columnName) throws IOException
Deprecated.deleteColumn.- Parameters:
tableName
- aString
object.columnName
- an array of byte.- Throws:
IOException
- if any.
-
deleteColumn
@Deprecated public void deleteColumn(String tableName, String columnName) throws IOException
Deprecated.deleteColumn.- Parameters:
tableName
- aString
object.columnName
- aString
object.- Throws:
IOException
- if any.
-
getClusterStatus
public ClusterStatus getClusterStatus() throws IOException
- Specified by:
getClusterStatus
in interfaceAdmin
- Throws:
IOException
-
getConfiguration
public org.apache.hadoop.conf.Configuration getConfiguration()
- Specified by:
getConfiguration
in interfaceAdmin
-
getTableRegions
public List<HRegionInfo> getTableRegions(TableName tableName) throws IOException
- Specified by:
getTableRegions
in interfaceAdmin
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceAdmin
- Throws:
IOException
-
getTableDescriptorsByTableName
public HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames) throws IOException
- Specified by:
getTableDescriptorsByTableName
in interfaceAdmin
- Throws:
IOException
-
getTableDescriptors
public HTableDescriptor[] getTableDescriptors(List<String> names) throws IOException
- Specified by:
getTableDescriptors
in interfaceAdmin
- Throws:
IOException
-
getOperationTimeout
public int getOperationTimeout()
- Specified by:
getOperationTimeout
in interfaceAdmin
-
isAborted
public boolean isAborted()
-
truncateTable
public void truncateTable(TableName tableName, boolean preserveSplits) throws IOException
- Specified by:
truncateTable
in interfaceAdmin
- Throws:
IOException
-
deleteRowRangeByPrefix
public void deleteRowRangeByPrefix(TableName tableName, byte[] prefix) throws IOException
deleteRowRangeByPrefix.- Parameters:
tableName
- aTableName
object.prefix
- an array of byte.- Throws:
IOException
- if any.
-
isTableAvailable
public boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException
- Specified by:
isTableAvailable
in interfaceAdmin
- Throws:
IOException
-
getAlterStatus
public Pair<Integer,Integer> getAlterStatus(TableName tableName) throws IOException
HBase column operations are not synchronous, since they're not as fast as Bigtable. Bigtable does not have async operations, so always return (0, 0). This is needed for some shell operations.
- Specified by:
getAlterStatus
in interfaceAdmin
- Throws:
IOException
-
getAlterStatus
public Pair<Integer,Integer> getAlterStatus(byte[] tableName) throws IOException
- Specified by:
getAlterStatus
in interfaceAdmin
- Throws:
IOException
-
getAlterStatus
public Pair<Integer,Integer> getAlterStatus(String tableName) throws IOException
getAlterStatus.- Parameters:
tableName
- aString
object.- Returns:
- a
Pair
object. - Throws:
IOException
- if any.
-
snapshot
public void snapshot(String snapshotName, TableName tableName) throws IOException, SnapshotCreationException, IllegalArgumentException
Creates a snapshot from an existing table. NOTE: Cloud Bigtable has a cleanup policy- Specified by:
snapshot
in interfaceAdmin
- Parameters:
snapshotName
- aString
object.tableName
- aTableName
object.- Throws:
IOException
- if any.SnapshotCreationException
IllegalArgumentException
-
snapshotTable
protected com.google.longrunning.Operation snapshotTable(String snapshotName, TableName tableName) throws IOException
Creates a snapshot from an existing table. NOTE: Cloud Bigtable has a cleanup policy- Parameters:
snapshotName
- aString
object.tableName
- aTableName
object.- Returns:
- a
Operation
object. - Throws:
IOException
- if any.
-
snapshot
public void snapshot(byte[] snapshotName, byte[] tableName) throws IOException, IllegalArgumentException
This is needed for the hbase shell.- Parameters:
snapshotName
- a byte array object.tableName
- a byte array object.- Throws:
IOException
- if any.IllegalArgumentException
-
snapshot
public void snapshot(byte[] snapshotName, TableName tableName) throws IOException, IllegalArgumentException
- Specified by:
snapshot
in interfaceAdmin
- Throws:
IOException
IllegalArgumentException
-
cloneSnapshot
public void cloneSnapshot(byte[] snapshotName, byte[] tableName) throws IOException
This is needed for the hbase shell.- Parameters:
snapshotName
- a byte array object.tableName
- a byte array object.- Throws:
IOException
- if any.
-
cloneSnapshot
public void cloneSnapshot(byte[] snapshotName, TableName tableName) throws IOException, TableExistsException, RestoreSnapshotException
- Specified by:
cloneSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- aString
object.tableName
- aTableName
object.- Throws:
IOException
- if any.TableExistsException
RestoreSnapshotException
-
cloneSnapshot
public void cloneSnapshot(String snapshotName, TableName tableName) throws IOException, TableExistsException, RestoreSnapshotException
- Specified by:
cloneSnapshot
in interfaceAdmin
- Parameters:
snapshotName
- aString
object.tableName
- aTableName
object.- Throws:
IOException
- if any.TableExistsException
RestoreSnapshotException
-
getClusterName
protected BigtableClusterName getClusterName() throws IOException
- Throws:
IOException
-
getSnapshotClusterName
protected BigtableClusterName getSnapshotClusterName() throws IOException
- Throws:
IOException
-
deleteSnapshot
public void deleteSnapshot(byte[] snapshotName) throws IOException
- Specified by:
deleteSnapshot
in interfaceAdmin
- Throws:
IOException
-
deleteSnapshot
public void deleteSnapshot(String snapshotName) throws IOException
- Specified by:
deleteSnapshot
in interfaceAdmin
- Throws:
IOException
-
deleteSnapshots
public void deleteSnapshots(String regex) throws IOException
The snapshots will be deleted serially and the first failure will prevent the deletion of the remaining snapshots.
- Specified by:
deleteSnapshots
in interfaceAdmin
- Throws:
IOException
-
deleteSnapshots
public void deleteSnapshots(Pattern pattern) throws IOException
The snapshots will be deleted serially and the first failure will prevent the deletion of the remaining snapshots.
- Specified by:
deleteSnapshots
in interfaceAdmin
- Throws:
IOException
-
deleteTableSnapshots
public void deleteTableSnapshots(String tableNameRegex, String snapshotNameRegex) throws IOException
- Specified by:
deleteTableSnapshots
in interfaceAdmin
- Throws:
IOException
-
deleteTableSnapshots
public void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) throws IOException
The snapshots will be deleted serially and the first failure will prevent the deletion of the remaining snapshots.
- Specified by:
deleteTableSnapshots
in interfaceAdmin
- Throws:
IOException
-
restoreSnapshot
public void restoreSnapshot(byte[] snapshotName) throws IOException, RestoreSnapshotException
- Specified by:
restoreSnapshot
in interfaceAdmin
- Throws:
IOException
RestoreSnapshotException
-
restoreSnapshot
public void restoreSnapshot(String snapshotName) throws IOException, RestoreSnapshotException
- Specified by:
restoreSnapshot
in interfaceAdmin
- Throws:
IOException
RestoreSnapshotException
-
restoreSnapshot
public void restoreSnapshot(byte[] snapshotName, boolean takeFailSafeSnapshot) throws IOException, RestoreSnapshotException
- Specified by:
restoreSnapshot
in interfaceAdmin
- Throws:
IOException
RestoreSnapshotException
-
restoreSnapshot
public void restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot) throws IOException, RestoreSnapshotException
- Specified by:
restoreSnapshot
in interfaceAdmin
- Throws:
IOException
RestoreSnapshotException
-
closeRegion
public void closeRegion(String regionname, String serverName) throws IOException
- Specified by:
closeRegion
in interfaceAdmin
- Throws:
IOException
-
closeRegion
public void closeRegion(byte[] regionname, String serverName) throws IOException
- Specified by:
closeRegion
in interfaceAdmin
- Throws:
IOException
-
closeRegionWithEncodedRegionName
public boolean closeRegionWithEncodedRegionName(String encodedRegionName, String serverName) throws IOException
- Specified by:
closeRegionWithEncodedRegionName
in interfaceAdmin
- Throws:
IOException
-
closeRegion
public void closeRegion(ServerName sn, HRegionInfo hri) throws IOException
- Specified by:
closeRegion
in interfaceAdmin
- Throws:
IOException
-
getOnlineRegions
public List<HRegionInfo> getOnlineRegions(ServerName sn) throws IOException
- Specified by:
getOnlineRegions
in interfaceAdmin
- Throws:
IOException
-
flush
public void flush(TableName tableName) throws IOException
- Specified by:
flush
in interfaceAdmin
- Throws:
IOException
-
flushRegion
public void flushRegion(byte[] bytes) throws IOException
- Specified by:
flushRegion
in interfaceAdmin
- Throws:
IOException
-
compact
public void compact(TableName tableName) throws IOException
- Specified by:
compact
in interfaceAdmin
- Throws:
IOException
-
compactRegion
public void compactRegion(byte[] bytes) throws IOException
- Specified by:
compactRegion
in interfaceAdmin
- Throws:
IOException
-
compact
public void compact(TableName tableName, byte[] bytes) throws IOException
- Specified by:
compact
in interfaceAdmin
- Throws:
IOException
-
compactRegion
public void compactRegion(byte[] bytes, byte[] bytes2) throws IOException
- Specified by:
compactRegion
in interfaceAdmin
- Throws:
IOException
-
majorCompact
public void majorCompact(TableName tableName) throws IOException
- Specified by:
majorCompact
in interfaceAdmin
- Throws:
IOException
-
majorCompactRegion
public void majorCompactRegion(byte[] bytes) throws IOException
- Specified by:
majorCompactRegion
in interfaceAdmin
- Throws:
IOException
-
majorCompact
public void majorCompact(TableName tableName, byte[] bytes) throws IOException
- Specified by:
majorCompact
in interfaceAdmin
- Throws:
IOException
-
majorCompactRegion
public void majorCompactRegion(byte[] bytes, byte[] bytes2) throws IOException
- Specified by:
majorCompactRegion
in interfaceAdmin
- Throws:
IOException
-
compactRegionServer
public void compactRegionServer(ServerName serverName, boolean b) throws IOException
- Specified by:
compactRegionServer
in interfaceAdmin
- Throws:
IOException
-
move
public void move(byte[] encodedRegionName, byte[] destServerName) throws HBaseIOException, MasterNotRunningException, ZooKeeperConnectionException
- Specified by:
move
in interfaceAdmin
- Throws:
HBaseIOException
MasterNotRunningException
ZooKeeperConnectionException
-
assign
public void assign(byte[] regionName) throws MasterNotRunningException, ZooKeeperConnectionException, IOException
- Specified by:
assign
in interfaceAdmin
- Throws:
MasterNotRunningException
ZooKeeperConnectionException
IOException
-
unassign
public void unassign(byte[] regionName, boolean force) throws MasterNotRunningException, ZooKeeperConnectionException, IOException
- Specified by:
unassign
in interfaceAdmin
- Throws:
MasterNotRunningException
ZooKeeperConnectionException
IOException
-
offline
public void offline(byte[] regionName) throws IOException
- Specified by:
offline
in interfaceAdmin
- Throws:
IOException
-
setBalancerRunning
public boolean setBalancerRunning(boolean on, boolean synchronous) throws MasterNotRunningException, ZooKeeperConnectionException
- Specified by:
setBalancerRunning
in interfaceAdmin
- Throws:
MasterNotRunningException
ZooKeeperConnectionException
-
balancer
public boolean balancer() throws MasterNotRunningException, ZooKeeperConnectionException
- Specified by:
balancer
in interfaceAdmin
- Throws:
MasterNotRunningException
ZooKeeperConnectionException
-
enableCatalogJanitor
public boolean enableCatalogJanitor(boolean enable) throws MasterNotRunningException
- Specified by:
enableCatalogJanitor
in interfaceAdmin
- Throws:
MasterNotRunningException
-
runCatalogScan
public int runCatalogScan() throws MasterNotRunningException
- Specified by:
runCatalogScan
in interfaceAdmin
- Throws:
MasterNotRunningException
-
isCatalogJanitorEnabled
public boolean isCatalogJanitorEnabled() throws MasterNotRunningException
- Specified by:
isCatalogJanitorEnabled
in interfaceAdmin
- Throws:
MasterNotRunningException
-
mergeRegions
public void mergeRegions(byte[] encodedNameOfRegionA, byte[] encodedNameOfRegionB, boolean forcible) throws IOException
- Specified by:
mergeRegions
in interfaceAdmin
- Throws:
IOException
-
split
public void split(TableName tableName) throws IOException
- Specified by:
split
in interfaceAdmin
- Throws:
IOException
-
splitRegion
public void splitRegion(byte[] bytes) throws IOException
- Specified by:
splitRegion
in interfaceAdmin
- Throws:
IOException
-
split
public void split(TableName tableName, byte[] bytes) throws IOException
- Specified by:
split
in interfaceAdmin
- Throws:
IOException
-
splitRegion
public void splitRegion(byte[] bytes, byte[] bytes2) throws IOException
- Specified by:
splitRegion
in interfaceAdmin
- Throws:
IOException
-
shutdown
public void shutdown() throws IOException
- Specified by:
shutdown
in interfaceAdmin
- Throws:
IOException
-
stopMaster
public void stopMaster() throws IOException
- Specified by:
stopMaster
in interfaceAdmin
- Throws:
IOException
-
stopRegionServer
public void stopRegionServer(String hostnamePort) throws IOException
- Specified by:
stopRegionServer
in interfaceAdmin
- Throws:
IOException
-
createNamespace
public void createNamespace(NamespaceDescriptor descriptor) throws IOException
- Specified by:
createNamespace
in interfaceAdmin
- Throws:
IOException
-
modifyNamespace
public void modifyNamespace(NamespaceDescriptor descriptor) throws IOException
- Specified by:
modifyNamespace
in interfaceAdmin
- Throws:
IOException
-
deleteNamespace
public void deleteNamespace(String name) throws IOException
- Specified by:
deleteNamespace
in interfaceAdmin
- Throws:
IOException
-
getNamespaceDescriptor
public NamespaceDescriptor getNamespaceDescriptor(String name) throws IOException
- Specified by:
getNamespaceDescriptor
in interfaceAdmin
- Throws:
IOException
-
listNamespaceDescriptors
public NamespaceDescriptor[] listNamespaceDescriptors() throws IOException
- Specified by:
listNamespaceDescriptors
in interfaceAdmin
- Throws:
IOException
-
listTableDescriptorsByNamespace
public HTableDescriptor[] listTableDescriptorsByNamespace(String name) throws IOException
- Specified by:
listTableDescriptorsByNamespace
in interfaceAdmin
- Throws:
IOException
-
listTableNamesByNamespace
public TableName[] listTableNamesByNamespace(String name) throws IOException
- Specified by:
listTableNamesByNamespace
in interfaceAdmin
- Throws:
IOException
-
getMasterCoprocessors
public String[] getMasterCoprocessors()
- Specified by:
getMasterCoprocessors
in interfaceAdmin
-
execProcedure
public void execProcedure(String signature, String instance, Map<String,String> props) throws IOException
- Specified by:
execProcedure
in interfaceAdmin
- Throws:
IOException
-
execProcedureWithRet
public byte[] execProcedureWithRet(String signature, String instance, Map<String,String> props) throws IOException
- Specified by:
execProcedureWithRet
in interfaceAdmin
- Throws:
IOException
-
isProcedureFinished
public boolean isProcedureFinished(String signature, String instance, Map<String,String> props) throws IOException
- Specified by:
isProcedureFinished
in interfaceAdmin
- Throws:
IOException
-
coprocessorService
public CoprocessorRpcChannel coprocessorService()
- Specified by:
coprocessorService
in interfaceAdmin
-
coprocessorService
public CoprocessorRpcChannel coprocessorService(ServerName serverName)
- Specified by:
coprocessorService
in interfaceAdmin
-
updateConfiguration
public void updateConfiguration(ServerName serverName) throws IOException
- Specified by:
updateConfiguration
in interfaceAdmin
- Throws:
IOException
-
updateConfiguration
public void updateConfiguration() throws IOException
- Specified by:
updateConfiguration
in interfaceAdmin
- Throws:
IOException
-
getMasterInfoPort
public int getMasterInfoPort() throws IOException
- Specified by:
getMasterInfoPort
in interfaceAdmin
- Throws:
IOException
-
rollWALWriter
public void rollWALWriter(ServerName serverName) throws IOException, FailedLogCloseException
- Specified by:
rollWALWriter
in interfaceAdmin
- Throws:
IOException
FailedLogCloseException
-
-