@InterfaceAudience.Private public class DeadServer extends Object
Modifier and Type | Field and Description |
---|---|
private Map<ServerName,Long> |
deadServers
Set of known dead servers.
|
private static org.apache.commons.logging.Log |
LOG |
private int |
numProcessing
Number of dead servers currently being processed
|
private boolean |
processing
Whether a dead server is being processed currently.
|
private static Comparator<Pair<ServerName,Long>> |
ServerNameDeathDateComparator |
Constructor and Description |
---|
DeadServer() |
Modifier and Type | Method and Description |
---|---|
void |
add(ServerName sn)
Adds the server to the dead server list if it's not there already.
|
boolean |
areDeadServersInProgress()
Checks if there are currently any dead servers being processed by the
master.
|
void |
cleanAllPreviousInstances(ServerName newServerName) |
boolean |
cleanPreviousInstance(ServerName newServerName)
A dead server that comes back alive has a different start code.
|
List<Pair<ServerName,Long>> |
copyDeadServersSince(long ts)
Extract all the servers dead since a given time, and sort them.
|
Set<ServerName> |
copyServerNames() |
void |
finish(ServerName sn) |
Date |
getTimeOfDeath(ServerName deadServerName)
Get the time when a server died
|
boolean |
isDeadServer(ServerName serverName) |
boolean |
isEmpty() |
void |
notifyServer(ServerName sn)
Notify that we started processing this dead server.
|
int |
size() |
String |
toString() |
private static final org.apache.commons.logging.Log LOG
private final Map<ServerName,Long> deadServers
private int numProcessing
private boolean processing
private static Comparator<Pair<ServerName,Long>> ServerNameDeathDateComparator
public boolean cleanPreviousInstance(ServerName newServerName)
newServerName
- Servername as either host:port
or
host,port,startcode
.public boolean isDeadServer(ServerName serverName)
serverName
- server name.public boolean areDeadServersInProgress()
public Set<ServerName> copyServerNames()
public void add(ServerName sn)
sn
- the server namepublic void notifyServer(ServerName sn)
sn
- ServerName for the dead server.public void finish(ServerName sn)
public int size()
public boolean isEmpty()
public void cleanAllPreviousInstances(ServerName newServerName)
public List<Pair<ServerName,Long>> copyDeadServersSince(long ts)
ts
- the time, 0 for allpublic Date getTimeOfDeath(ServerName deadServerName)
deadServerName
- the dead server nameCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.