public class RSGroupInfoManagerImpl extends java.lang.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(java.lang.String groupName)
Gets the group information.
|
RSGroupInfo |
getRSGroupOfServer(HostAndPort hostPort)
Gets the group info of server.
|
java.lang.String |
getRSGroupOfTable(TableName tableName)
Get the group membership of a table
|
boolean |
isOnline()
Whether the manager is able to fully
return group metadata
|
java.util.List<RSGroupInfo> |
listRSGroups()
List the groups
|
boolean |
moveServers(java.util.Set<HostAndPort> hostPorts,
java.lang.String srcGroup,
java.lang.String dstGroup)
move servers to a new group.
|
void |
moveTables(java.util.Set<TableName> tableNames,
java.lang.String groupName)
Set the group membership of a set of tables
|
void |
refresh()
Refresh/reload the group information from
the persistent store
|
void |
removeRSGroup(java.lang.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 java.io.IOException
java.io.IOExceptionpublic void addRSGroup(RSGroupInfo rsGroupInfo) throws java.io.IOException
addRSGroup in interface RSGroupInfoManagerrsGroupInfo - the group namejava.io.IOException - Signals that an I/O exception has occurred.public boolean moveServers(java.util.Set<HostAndPort> hostPorts,
java.lang.String srcGroup,
java.lang.String dstGroup)
throws java.io.IOException
RSGroupInfoManagermoveServers in interface RSGroupInfoManagerhostPorts - list of servers, must be part of the same groupsrcGroup - groupName being moved fromdstGroup - groupName being moved tojava.io.IOException - on move failurepublic RSGroupInfo getRSGroupOfServer(HostAndPort hostPort) throws java.io.IOException
getRSGroupOfServer in interface RSGroupInfoManagerhostPort - the serverjava.io.IOExceptionpublic RSGroupInfo getRSGroup(java.lang.String groupName) throws java.io.IOException
getRSGroup in interface RSGroupInfoManagergroupName - the group namejava.io.IOExceptionpublic java.lang.String getRSGroupOfTable(TableName tableName) throws java.io.IOException
RSGroupInfoManagergetRSGroupOfTable in interface RSGroupInfoManagertableName - name of table to get group membershipjava.io.IOException - on failure to retrive informationpublic void moveTables(java.util.Set<TableName> tableNames, java.lang.String groupName) throws java.io.IOException
RSGroupInfoManagermoveTables in interface RSGroupInfoManagertableNames - set of tables to movegroupName - name of group of tables to move tojava.io.IOException - on failure to movepublic void removeRSGroup(java.lang.String groupName)
throws java.io.IOException
removeRSGroup in interface RSGroupInfoManagergroupName - the group namejava.io.IOException - Signals that an I/O exception has occurred.public java.util.List<RSGroupInfo> listRSGroups() throws java.io.IOException
RSGroupInfoManagerlistRSGroups in interface RSGroupInfoManagerjava.io.IOException - on failurepublic boolean isOnline()
RSGroupInfoManagerisOnline in interface RSGroupInfoManagerpublic void refresh()
throws java.io.IOException
RSGroupInfoManagerrefresh in interface RSGroupInfoManagerjava.io.IOException - on failure to refreshpublic void serverAdded(ServerName serverName)
ServerListenerserverAdded in interface ServerListenerserverName - The remote servers name.public void serverRemoved(ServerName serverName)
ServerListenerserverRemoved in interface ServerListenerserverName - The remote servers name.