|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.master.ServerManager
public class ServerManager
The ServerManager class manages info about region servers.
Maintains lists of online and dead servers. Processes the startups, shutdowns, and deaths of region servers.
Servers are distinguished in two different ways. A given server has a location, specified by hostname and port, and of which there can only be one online at any given time. A server instance is specified by the location (hostname and port) as well as the startcode (timestamp from when the server was started). This is used to differentiate a restarted instance of a given server from the original instance.
Field Summary | |
---|---|
static String |
WAIT_ON_REGIONSERVERS_INTERVAL
|
static String |
WAIT_ON_REGIONSERVERS_MAXTOSTART
|
static String |
WAIT_ON_REGIONSERVERS_MINTOSTART
|
static String |
WAIT_ON_REGIONSERVERS_TIMEOUT
|
Constructor Summary | |
---|---|
ServerManager(Server master,
MasterServices services)
Constructor. |
Method Summary | |
---|---|
boolean |
addServerToDrainList(ServerName sn)
|
boolean |
areDeadServersInProgress()
Checks if any dead servers are currently in progress. |
void |
expireServer(ServerName serverName)
|
double |
getAverageLoad()
Compute the average load across all region servers. |
Set<ServerName> |
getDeadServers()
|
List<ServerName> |
getDrainingServersList()
|
HServerLoad |
getLoad(HServerAddress address)
Deprecated. Use getLoad(HServerAddress) |
HServerLoad |
getLoad(ServerName serverName)
|
Map<ServerName,HServerLoad> |
getOnlineServers()
|
List<ServerName> |
getOnlineServersList()
|
boolean |
isClusterShutdown()
|
boolean |
isServerOnline(ServerName serverName)
|
boolean |
removeServerFromDrainList(ServerName sn)
|
boolean |
sendRegionClose(ServerName server,
HRegionInfo region,
int versionOfClosingNode)
Sends an CLOSE RPC to the specified server to close the specified region. |
RegionOpeningState |
sendRegionOpen(ServerName server,
HRegionInfo region,
int versionOfOfflineNode)
Sends an OPEN RPC to the specified server to open the specified region. |
void |
sendRegionOpen(ServerName server,
List<HRegionInfo> regions)
Sends an OPEN RPC to the specified server to open the specified region. |
void |
shutdownCluster()
|
void |
stop()
Stop the ServerManager. |
void |
waitForRegionServers(MonitoredTask status)
Wait for the region servers to report in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String WAIT_ON_REGIONSERVERS_MAXTOSTART
public static final String WAIT_ON_REGIONSERVERS_MINTOSTART
public static final String WAIT_ON_REGIONSERVERS_TIMEOUT
public static final String WAIT_ON_REGIONSERVERS_INTERVAL
Constructor Detail |
---|
public ServerManager(Server master, MasterServices services) throws ZooKeeperConnectionException
master
- services
-
ZooKeeperConnectionException
Method Detail |
---|
public HServerLoad getLoad(ServerName serverName)
serverName
-
public HServerLoad getLoad(HServerAddress address)
getLoad(HServerAddress)
address
-
public double getAverageLoad()
public Map<ServerName,HServerLoad> getOnlineServers()
public Set<ServerName> getDeadServers()
public boolean areDeadServersInProgress()
public void expireServer(ServerName serverName)
public boolean removeServerFromDrainList(ServerName sn)
public boolean addServerToDrainList(ServerName sn)
public RegionOpeningState sendRegionOpen(ServerName server, HRegionInfo region, int versionOfOfflineNode) throws IOException
Open should not fail but can if server just crashed.
server
- server to open a regionregion
- region to openversionOfOfflineNode
- that needs to be present in the offline node
when RS tries to change the state from OFFLINE to other states.
IOException
public void sendRegionOpen(ServerName server, List<HRegionInfo> regions) throws IOException
Open should not fail but can if server just crashed.
server
- server to open a regionregions
- regions to open
IOException
public boolean sendRegionClose(ServerName server, HRegionInfo region, int versionOfClosingNode) throws IOException
A region server could reject the close request because it either does not have the specified region or the region is being split.
server
- server to open a regionregion
- region to openversionOfClosingNode
- the version of znode to compare when RS transitions the znode from
CLOSING state.
IOException
public void waitForRegionServers(MonitoredTask status) throws InterruptedException
InterruptedException
public List<ServerName> getOnlineServersList()
public List<ServerName> getDrainingServersList()
public boolean isServerOnline(ServerName serverName)
public void shutdownCluster()
public boolean isClusterShutdown()
public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |