public interface HMasterInterface extends VersionedProtocol
NOTE: if you change the interface, you must change the RPC version number in HBaseRPCProtocolVersion
Modifier and Type | Field and Description |
---|---|
static long |
VERSION
This Interfaces' version.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(byte[] tableName,
HColumnDescriptor column)
Adds a column to the specified table
|
void |
assign(byte[] regionName)
Assign a region to a server chosen at random.
|
void |
assign(byte[] regionName,
boolean force)
Deprecated.
The
force is unused.Use assign(byte[]) |
boolean |
balance()
Run the balancer.
|
boolean |
balanceSwitch(boolean b)
Turn the load balancer on or off.
|
void |
createTable(HTableDescriptor desc,
byte[][] splitKeys)
Creates a new table asynchronously.
|
void |
deleteColumn(byte[] tableName,
byte[] columnName)
Deletes a column from the specified table.
|
void |
deleteSnapshot(HSnapshotDescription snapshot) |
void |
deleteTable(byte[] tableName)
Deletes a table
|
void |
disableTable(byte[] tableName)
Take table offline
|
void |
enableTable(byte[] tableName)
Puts the table on-line (only needed if table has been previously taken offline)
|
ExecResult |
execCoprocessor(Exec call)
Executes a single
CoprocessorProtocol
method using the registered protocol handlers. |
Pair<Integer,Integer> |
getAlterStatus(byte[] tableName)
Used by the client to get the number of regions that have received the
updated schema
|
ClusterStatus |
getClusterStatus()
Return cluster status.
|
List<HSnapshotDescription> |
getCompletedSnapshots() |
HTableDescriptor[] |
getHTableDescriptors()
Get array of all HTDs.
|
HTableDescriptor[] |
getHTableDescriptors(List<String> tableNames)
Get array of HTDs for requested tables.
|
String[] |
getTableNames()
Return all table names.
|
boolean |
isMasterRunning() |
boolean |
isRestoreSnapshotDone(HSnapshotDescription request) |
boolean |
isSnapshotDone(HSnapshotDescription snapshot) |
void |
modifyColumn(byte[] tableName,
HColumnDescriptor descriptor)
Modifies an existing column on the specified table
|
void |
modifyTable(byte[] tableName,
HTableDescriptor htd)
Modify a table's metadata
|
void |
move(byte[] encodedRegionName,
byte[] destServerName)
Move the region
r to dest . |
void |
offline(byte[] regionName)
Offline a region from the assignment manager's in-memory state.
|
void |
restoreSnapshot(HSnapshotDescription request) |
void |
shutdown()
Shutdown an HBase cluster.
|
long |
snapshot(HSnapshotDescription snapshot) |
void |
stopMaster()
Stop HBase Master only.
|
boolean |
synchronousBalanceSwitch(boolean b)
Turn the load balancer on or off.
|
void |
unassign(byte[] regionName,
boolean force)
Unassign a region from current hosting regionserver.
|
getProtocolSignature, getProtocolVersion
static final long VERSION
boolean isMasterRunning()
void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException
desc
- table descriptorsplitKeys
- IOException
void deleteTable(byte[] tableName) throws IOException
tableName
- table to deleteIOException
- ePair<Integer,Integer> getAlterStatus(byte[] tableName) throws IOException
tableName
- IOException
void addColumn(byte[] tableName, HColumnDescriptor column) throws IOException
tableName
- table to modifycolumn
- column descriptorIOException
- evoid modifyColumn(byte[] tableName, HColumnDescriptor descriptor) throws IOException
tableName
- table namedescriptor
- new column descriptorIOException
- evoid deleteColumn(byte[] tableName, byte[] columnName) throws IOException
tableName
- table to altercolumnName
- column family to removeIOException
- evoid enableTable(byte[] tableName) throws IOException
tableName
- table to enableIOException
- evoid disableTable(byte[] tableName) throws IOException
tableName
- table to take offlineIOException
- evoid modifyTable(byte[] tableName, HTableDescriptor htd) throws IOException
tableName
- table to modifyhtd
- new descriptor for tableIOException
- evoid shutdown() throws IOException
IOException
- evoid stopMaster() throws IOException
IOException
- eClusterStatus getClusterStatus()
IOException
void move(byte[] encodedRegionName, byte[] destServerName) throws UnknownRegionException
r
to dest
.encodedRegionName
- The encoded region name; i.e. the hash that makes
up the region name suffix: e.g. if regionname is
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.
,
then the encoded region name is: 527db22f95c8a9e0116f0cc13c680396
.destServerName
- The servername of the destination regionserver. If
passed the empty byte array we'll assign to a random server. A server name
is made of host, port and startcode. Here is an example:
host187.example.com,60020,1289493121758
.UnknownRegionException
- Thrown if we can't find a region named
encodedRegionName
void assign(byte[] regionName, boolean force) throws IOException
regionName
- Region to assign. Will use existing RegionPlan if one
found.force
- If true, will force the assignment.IOException
void assign(byte[] regionName) throws IOException
regionName
- Region to assign. Will use existing RegionPlan if one found.IOException
void unassign(byte[] regionName, boolean force) throws IOException
move(byte[], byte[])
if you want
to control the region movement.regionName
- Region to unassign. Will clear any existing RegionPlan
if one found.force
- If true, force unassign (Will remove region from
regions-in-transition too if present as well as from assigned regions --
radical!.If results in double assignment use hbck -fix to resolve.IOException
void offline(byte[] regionName) throws IOException
regionName
- Region to offline. Will clear any existing RegionPlan
if one found.IOException
boolean balance()
boolean balanceSwitch(boolean b)
b
- If true, enable balancer. If false, disable balancer.boolean synchronousBalanceSwitch(boolean b)
b
- If true, enable balancer. If false, disable balancer.HTableDescriptor[] getHTableDescriptors() throws IOException
NOTE: This interface up to and including 0.94.8 included a getHTableDescriptors which did not throw IOE. Adding and deleting checked exceptions declared as thrown by a method does not break binary compatibility, so rolling restart scenarios will work; however, it will break contract compatibility possibly requiring source code changes upon next recompilation.
IOException
HTableDescriptor[] getHTableDescriptors(List<String> tableNames) throws IOException
NOTE: This interface up to and including 0.94.8 included a getHTableDescriptors which did not throw IOE. Adding and deleting checked exceptions declared as thrown by a method does not break binary compatibility, so rolling restart scenarios will work; however, it will break contract compatibility possibly requiring source code changes upon next recompilation.
tableNames
- IOException
ExecResult execCoprocessor(Exec call) throws IOException
CoprocessorProtocol
method using the registered protocol handlers.
CoprocessorProtocol
implementations must be registered via the
MasterServices.registerProtocol(Class, CoprocessorProtocol)
method before they are available.call
- an Exec
instance identifying the protocol, method name,
and parameters for the method invocationExecResult
instance containing the region name of the
invocation and the return valueIOException
- if no registered protocol handler is found or an error
occurs during the invocationMasterServices.registerProtocol(Class, CoprocessorProtocol)
long snapshot(HSnapshotDescription snapshot) throws IOException
IOException
List<HSnapshotDescription> getCompletedSnapshots() throws IOException
IOException
void deleteSnapshot(HSnapshotDescription snapshot) throws IOException
IOException
boolean isSnapshotDone(HSnapshotDescription snapshot) throws IOException
IOException
void restoreSnapshot(HSnapshotDescription request) throws IOException
IOException
boolean isRestoreSnapshotDone(HSnapshotDescription request) throws IOException
IOException
String[] getTableNames() throws IOException
IOException
- if an error occurred while getting the list of tablesCopyright © 2014 The Apache Software Foundation. All Rights Reserved.