|
||||||||||
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 - HServerInfo, load numbers, dying servers, etc.
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.
Constructor Summary | |
---|---|
ServerManager(Server master,
MasterServices services,
MasterMetrics metrics)
Constructor. |
Method Summary | |
---|---|
boolean |
areDeadServersInProgress()
Checks if any dead servers are currently in progress. |
void |
expireServer(HServerInfo hsi)
|
double |
getAverageLoad()
Compute the average load across all region servers. |
Set<String> |
getDeadServers()
|
HServerInfo |
getHServerInfo(HServerAddress hsa)
|
Map<String,HServerInfo> |
getOnlineServers()
|
List<HServerInfo> |
getOnlineServersList()
|
HServerInfo |
getServerInfo(String name)
|
boolean |
isClusterShutdown()
|
boolean |
isServerOnline(String serverName)
|
boolean |
sendRegionClose(HServerInfo server,
HRegionInfo region)
Sends an CLOSE RPC to the specified server to close the specified region. |
void |
sendRegionOpen(HServerInfo server,
HRegionInfo region)
Sends an OPEN RPC to the specified server to open the specified region. |
void |
sendRegionOpen(HServerInfo server,
List<HRegionInfo> regions)
Sends an OPEN RPC to the specified server to open the specified region. |
void |
shutdownCluster()
|
void |
stop()
Stop the ServerManager. |
int |
waitForRegionServers()
Waits for the regionservers to report in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerManager(Server master, MasterServices services, MasterMetrics metrics)
master
- services
- metrics
- Method Detail |
---|
public double getAverageLoad()
public HServerInfo getServerInfo(String name)
name
- server name
public Map<String,HServerInfo> getOnlineServers()
public Set<String> getDeadServers()
public boolean areDeadServersInProgress()
public HServerInfo getHServerInfo(HServerAddress hsa)
hsa
-
hsa
or null
if nothing found.public void expireServer(HServerInfo hsi)
public void sendRegionOpen(HServerInfo server, HRegionInfo region) throws IOException
Open should not fail but can if server just crashed.
server
- server to open a regionregion
- region to open
IOException
public void sendRegionOpen(HServerInfo 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(HServerInfo server, HRegionInfo region) 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 open
IOException
public int waitForRegionServers() throws InterruptedException
InterruptedException
public List<HServerInfo> getOnlineServersList()
public boolean isServerOnline(String 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 |