|
||||||||||
| 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. |
java.util.Set<java.lang.String> |
getDeadServers()
|
HServerInfo |
getHServerInfo(HServerAddress hsa)
|
java.util.Map<java.lang.String,HServerInfo> |
getOnlineServers()
|
java.util.List<HServerInfo> |
getOnlineServersList()
|
HServerInfo |
getServerInfo(java.lang.String name)
|
boolean |
isClusterShutdown()
|
boolean |
isServerOnline(java.lang.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,
java.util.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(java.lang.String name)
name - server name
public java.util.Map<java.lang.String,HServerInfo> getOnlineServers()
public java.util.Set<java.lang.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 java.io.IOException
Open should not fail but can if server just crashed.
server - server to open a regionregion - region to open
java.io.IOException
public void sendRegionOpen(HServerInfo server,
java.util.List<HRegionInfo> regions)
throws java.io.IOException
Open should not fail but can if server just crashed.
server - server to open a regionregions - regions to open
java.io.IOException
public boolean sendRegionClose(HServerInfo server,
HRegionInfo region)
throws java.io.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
java.io.IOException
public int waitForRegionServers()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.util.List<HServerInfo> getOnlineServersList()
public boolean isServerOnline(java.lang.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 | |||||||||