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.DEFAULT_REASSIGN_WAIT_INTERVAL, META_FAMILY_BYTES, META_QUALIFIER_BYTES, REASSIGN_WAIT_INTERVAL_KEY, ROW_KEY, RSGROUP_TABLE_NAME, 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(Address server)
Gets the group info of server.
|
String |
getRSGroupOfTable(TableName tableName)
Gets the group name for a given table
|
void |
init() |
boolean |
isOnline()
Whether the manager is able to fully return group metadata
|
List<RSGroupInfo> |
listRSGroups()
List the existing
RSGroupInfo s. |
Set<Address> |
moveServers(Set<Address> servers,
String srcGroup,
String dstGroup)
Move servers to a new group.
|
void |
moveServersAndTables(Set<Address> servers,
Set<TableName> tables,
String srcGroup,
String dstGroup)
Move servers and tables 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 |
removeServers(Set<Address> servers)
Remove decommissioned servers from rsgroup
|
void |
serverAdded(ServerName serverName)
The server has joined the cluster.
|
void |
serverRemoved(ServerName serverName)
The server was removed from the cluster.
|
void |
start() |
void |
waiting()
Started waiting on RegionServers to check-in.
|
public RSGroupInfoManagerImpl(MasterServices master) throws IOException
IOException
public void init() throws IOException
IOException
public void start()
start
in interface RSGroupInfoManager
public void addRSGroup(RSGroupInfo rsGroupInfo) throws IOException
addRSGroup
in interface RSGroupInfoManager
rsGroupInfo
- the group nameIOException
public Set<Address> moveServers(Set<Address> servers, String srcGroup, String dstGroup) throws IOException
RSGroupInfoManager
moveServers
in interface RSGroupInfoManager
servers
- list of servers, must be part of the same groupsrcGroup
- groupName being moved fromdstGroup
- groupName being moved toservers
).IOException
public RSGroupInfo getRSGroupOfServer(Address server) throws IOException
getRSGroupOfServer
in interface RSGroupInfoManager
server
- the serverIOException
public RSGroupInfo getRSGroup(String groupName) throws IOException
getRSGroup
in interface RSGroupInfoManager
groupName
- the group nameIOException
public String getRSGroupOfTable(TableName tableName) throws IOException
getRSGroupOfTable
in interface RSGroupInfoManager
tableName
- the table nameIOException
public 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
public 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
RSGroupInfo
s.listRSGroups
in interface RSGroupInfoManager
IOException
public boolean isOnline()
RSGroupInfoManager
isOnline
in interface RSGroupInfoManager
public void refresh() throws IOException
RSGroupInfoManager
refresh
in interface RSGroupInfoManager
IOException
public 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.public void waiting()
ServerListener
waiting
in interface ServerListener
public void moveServersAndTables(Set<Address> servers, Set<TableName> tables, String srcGroup, String dstGroup) throws IOException
RSGroupInfoManager
moveServersAndTables
in interface RSGroupInfoManager
servers
- list of servers, must be part of the same grouptables
- set of tables to movesrcGroup
- groupName being moved fromdstGroup
- groupName being moved toIOException
public void removeServers(Set<Address> servers) throws IOException
RSGroupInfoManager
removeServers
in interface RSGroupInfoManager
servers
- set of servers to removeIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.