Package org.apache.hadoop.hbase.rsgroup
Class RSGroupAdminClient
java.lang.Object
org.apache.hadoop.hbase.rsgroup.RSGroupAdminClient
- All Implemented Interfaces:
RSGroupAdmin
Client used for managing region server group information.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRSGroup
(String groupName) Creates a new RegionServer group with the given name.balanceRSGroup
(String groupName, BalanceRequest request) Balance regions in the given RegionServer group, running based on the givenBalanceRequest
.getRSGroupInfo
(String groupName) GetsRSGroupInfo
for given group name.getRSGroupInfoOfTable
(TableName tableName) GetsRSGroupInfo
for the given table's group.getRSGroupOfServer
(Address hostPort) Retrieve the RSGroupInfo a server is affiliated toLists current set of RegionServer groups.void
moveServers
(Set<Address> servers, String targetGroup) Move given set of servers to the specified target RegionServer group.void
Move given set of servers and tables to the specified target RegionServer group.void
moveTables
(Set<TableName> tables, String targetGroup) Move given set of tables to the specified target RegionServer group.void
removeRSGroup
(String name) Removes RegionServer group associated with the given name.void
removeServers
(Set<Address> servers) Remove decommissioned servers from rsgroup.void
renameRSGroup
(String oldName, String newName) Rename rsgroup.void
updateConfiguration
(String groupName) Update the configuration and trigger an online config change on all the regionservers in the RSGroup.void
updateRSGroupConfig
(String groupName, Map<String, String> configuration) Update RSGroup configurationMethods 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.rsgroup.RSGroupAdmin
balanceRSGroup
-
Field Details
-
stub
private org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos.RSGroupAdminService.BlockingInterface stub -
admin
-
-
Constructor Details
-
RSGroupAdminClient
- Throws:
IOException
-
-
Method Details
-
getRSGroupInfo
Description copied from interface:RSGroupAdmin
GetsRSGroupInfo
for given group name.- Specified by:
getRSGroupInfo
in interfaceRSGroupAdmin
- Throws:
IOException
-
getRSGroupInfoOfTable
Description copied from interface:RSGroupAdmin
GetsRSGroupInfo
for the given table's group.- Specified by:
getRSGroupInfoOfTable
in interfaceRSGroupAdmin
- Throws:
IOException
-
moveServers
Description copied from interface:RSGroupAdmin
Move given set of servers to the specified target RegionServer group.- Specified by:
moveServers
in interfaceRSGroupAdmin
- Throws:
IOException
-
moveTables
Description copied from interface:RSGroupAdmin
Move given set of tables to the specified target RegionServer group. This will unassign all of a table's region so it can be reassigned to the correct group.- Specified by:
moveTables
in interfaceRSGroupAdmin
- Throws:
IOException
-
addRSGroup
Description copied from interface:RSGroupAdmin
Creates a new RegionServer group with the given name.- Specified by:
addRSGroup
in interfaceRSGroupAdmin
- Throws:
IOException
-
removeRSGroup
Description copied from interface:RSGroupAdmin
Removes RegionServer group associated with the given name.- Specified by:
removeRSGroup
in interfaceRSGroupAdmin
- Throws:
IOException
-
balanceRSGroup
Description copied from interface:RSGroupAdmin
Balance regions in the given RegionServer group, running based on the givenBalanceRequest
.- Specified by:
balanceRSGroup
in interfaceRSGroupAdmin
- Returns:
- boolean Whether balance ran or not
- Throws:
IOException
-
listRSGroups
Description copied from interface:RSGroupAdmin
Lists current set of RegionServer groups.- Specified by:
listRSGroups
in interfaceRSGroupAdmin
- Throws:
IOException
-
getRSGroupOfServer
Description copied from interface:RSGroupAdmin
Retrieve the RSGroupInfo a server is affiliated to- Specified by:
getRSGroupOfServer
in interfaceRSGroupAdmin
- Parameters:
hostPort
- HostPort to get RSGroupInfo for- Throws:
IOException
-
moveServersAndTables
public void moveServersAndTables(Set<Address> servers, Set<TableName> tables, String targetGroup) throws IOException Description copied from interface:RSGroupAdmin
Move given set of servers and tables to the specified target RegionServer group.- Specified by:
moveServersAndTables
in interfaceRSGroupAdmin
- Parameters:
servers
- set of servers to movetables
- set of tables to movetargetGroup
- the target group name- Throws:
IOException
- if moving the server and tables fail
-
removeServers
Description copied from interface:RSGroupAdmin
Remove decommissioned servers from rsgroup. 1. Sometimes we may find the server aborted due to some hardware failure and we must offline the server for repairing. Or we need to move some servers to join other clusters. So we need to remove these servers from the rsgroup. 2. Dead/recovering/live servers will be disallowed.- Specified by:
removeServers
in interfaceRSGroupAdmin
- Parameters:
servers
- set of servers to remove- Throws:
IOException
-
renameRSGroup
Description copied from interface:RSGroupAdmin
Rename rsgroup.- Specified by:
renameRSGroup
in interfaceRSGroupAdmin
- Parameters:
oldName
- old rsgroup namenewName
- new rsgroup name- Throws:
IOException
-
updateRSGroupConfig
public void updateRSGroupConfig(String groupName, Map<String, String> configuration) throws IOExceptionDescription copied from interface:RSGroupAdmin
Update RSGroup configuration- Specified by:
updateRSGroupConfig
in interfaceRSGroupAdmin
- Parameters:
groupName
- the group nameconfiguration
- new configuration of the group name to be set- Throws:
IOException
- if a remote or network exception occurs
-
updateConfiguration
Description copied from interface:RSGroupAdmin
Update the configuration and trigger an online config change on all the regionservers in the RSGroup.- Specified by:
updateConfiguration
in interfaceRSGroupAdmin
- Parameters:
groupName
- the group name- Throws:
IOException
- if a remote or network exception occurs
-