public class RSGroupInfoManagerImpl extends Object implements RSGroupInfoManager, ServerListener
RSGroupInfoManager
. Which makes
use of an HBase table as the persistence store for the group information.
It also makes use of zookeeper to store group information needed
for bootstrapping during offline mode.META_FAMILY_BYTES, META_QUALIFIER_BYTES, ROW_KEY, RSGROUP_TABLE_NAME, RSGROUP_TABLE_NAME_BYTES, rsGroupZNode
Constructor and Description |
---|
RSGroupInfoManagerImpl(MasterServices master) |
Modifier and Type | Method and Description |
---|---|
void |
addRSGroup(RSGroupInfo rsGroupInfo)
Adds the group.
|
RSGroupInfo |
getRSGroup(String groupName)
Gets the group information.
|
RSGroupInfo |
getRSGroupOfServer(HostAndPort hostPort)
Gets the group info of server.
|
String |
getRSGroupOfTable(TableName tableName)
Get the group membership of a table
|
boolean |
isOnline()
Whether the manager is able to fully
return group metadata
|
List<RSGroupInfo> |
listRSGroups()
List the groups
|
boolean |
moveServers(Set<HostAndPort> hostPorts,
String srcGroup,
String dstGroup)
move servers to a new group.
|
void |
moveTables(Set<TableName> tableNames,
String groupName)
Set the group membership of a set of tables
|
void |
refresh()
Refresh/reload the group information from
the persistent store
|
void |
removeRSGroup(String groupName)
Delete a region server group.
|
void |
serverAdded(ServerName serverName)
The server has joined the cluster.
|
void |
serverRemoved(ServerName serverName)
The server was removed from the cluster.
|
public RSGroupInfoManagerImpl(MasterServices master) throws IOException
IOException
public void addRSGroup(RSGroupInfo rsGroupInfo) throws IOException
addRSGroup
in interface RSGroupInfoManager
rsGroupInfo
- the group nameIOException
- Signals that an I/O exception has occurred.public boolean moveServers(Set<HostAndPort> hostPorts, String srcGroup, String dstGroup) throws IOException
RSGroupInfoManager
moveServers
in interface RSGroupInfoManager
hostPorts
- list of servers, must be part of the same groupsrcGroup
- groupName being moved fromdstGroup
- groupName being moved toIOException
- on move failurepublic RSGroupInfo getRSGroupOfServer(HostAndPort hostPort) throws IOException
getRSGroupOfServer
in interface RSGroupInfoManager
hostPort
- the serverIOException
public RSGroupInfo getRSGroup(String groupName) throws IOException
getRSGroup
in interface RSGroupInfoManager
groupName
- the group nameIOException
public String getRSGroupOfTable(TableName tableName) throws IOException
RSGroupInfoManager
getRSGroupOfTable
in interface RSGroupInfoManager
tableName
- name of table to get group membershipIOException
- on failure to retrive informationpublic void moveTables(Set<TableName> tableNames, String groupName) throws IOException
RSGroupInfoManager
moveTables
in interface RSGroupInfoManager
tableNames
- set of tables to movegroupName
- name of group of tables to move toIOException
- on failure to movepublic void removeRSGroup(String groupName) throws IOException
removeRSGroup
in interface RSGroupInfoManager
groupName
- the group nameIOException
- Signals that an I/O exception has occurred.public List<RSGroupInfo> listRSGroups() throws IOException
RSGroupInfoManager
listRSGroups
in interface RSGroupInfoManager
IOException
- on failurepublic boolean isOnline()
RSGroupInfoManager
isOnline
in interface RSGroupInfoManager
public void refresh() throws IOException
RSGroupInfoManager
refresh
in interface RSGroupInfoManager
IOException
- on failure to refreshpublic void serverAdded(ServerName serverName)
ServerListener
serverAdded
in interface ServerListener
serverName
- The remote servers name.public void serverRemoved(ServerName serverName)
ServerListener
serverRemoved
in interface ServerListener
serverName
- The remote servers name.