@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.slf4j.Logger |
LOG |
private Set<ServerName> |
processingServers
Set of dead servers currently being processed by a SCP.
|
Constructor and Description |
---|
DeadServer() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areDeadServersInProgress()
Checks if there are currently any dead servers being processed by the
master.
|
(package private) void |
cleanAllPreviousInstances(ServerName newServerName) |
private boolean |
cleanOldServerName(ServerName newServerName,
Iterator<ServerName> deadServerIterator) |
(package private) boolean |
cleanPreviousInstance(ServerName newServerName)
Handles restart of a server.
|
(package private) 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)
Complete processing for this dead server.
|
Date |
getTimeOfDeath(ServerName deadServerName)
Get the time when a server died
|
boolean |
isDeadServer(ServerName serverName) |
(package private) boolean |
isEmpty() |
void |
processing(ServerName sn)
Add
sn< to set of processing deadservers. |
(package private) void |
putIfAbsent(ServerName sn)
Adds the server to the dead server list if it's not there already.
|
boolean |
removeDeadServer(ServerName deadServerName)
Called from rpc by operator cleaning up deadserver list.
|
int |
size() |
String |
toString() |
private static final org.slf4j.Logger LOG
private final Map<ServerName,Long> deadServers
private final Set<ServerName> processingServers
public DeadServer()
public boolean isDeadServer(ServerName serverName)
serverName
- server name.boolean areDeadServersInProgress()
public Set<ServerName> copyServerNames()
void putIfAbsent(ServerName sn)
public void processing(ServerName sn)
sn<
to set of processing deadservers.finish(ServerName)
public void finish(ServerName sn)
sn
- ServerName for the dead server.processing(ServerName)
public int size()
boolean isEmpty()
boolean cleanPreviousInstance(ServerName newServerName)
newServerName
- Servername as either host:port
or
host,port,startcode
.void cleanAllPreviousInstances(ServerName newServerName)
private boolean cleanOldServerName(ServerName newServerName, Iterator<ServerName> deadServerIterator)
newServerName
- Server to match port and hostname against.deadServerIterator
- Iterator primed so can call 'next' on it.newServerName
and current primed
iterator ServerName have same host and port and we removed old server
from iterator and from processing list.List<Pair<ServerName,Long>> copyDeadServersSince(long ts)
ts
- the time, 0 for allpublic Date getTimeOfDeath(ServerName deadServerName)
deadServerName
- the dead server namepublic boolean removeDeadServer(ServerName deadServerName)
deadServerName
- the dead server nameCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.