org.apache.hadoop.hbase.master
Class DeadServer

java.lang.Object
  extended by org.apache.hadoop.hbase.master.DeadServer

@InterfaceAudience.Private
public class DeadServer
extends Object

Class to hold dead servers list and utility querying dead server list.


Constructor Summary
DeadServer()
           
 
Method Summary
 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()
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeadServer

public DeadServer()
Method Detail

cleanPreviousInstance

public boolean cleanPreviousInstance(ServerName newServerName)
A dead server that comes back alive has a different start code. The new start code should be greater than the old one, but we don't take this into account in this method.

Parameters:
newServerName - Servername as either host:port or host,port,startcode.
Returns:
true if this server was dead before and coming back alive again

isDeadServer

public boolean isDeadServer(ServerName serverName)
Parameters:
serverName - server name.
Returns:
true if this server is on the dead servers list false otherwise

areDeadServersInProgress

public boolean areDeadServersInProgress()
Checks if there are currently any dead servers being processed by the master. Returns true if at least one region server is currently being processed as dead.

Returns:
true if any RS are being processed as dead

copyServerNames

public Set<ServerName> copyServerNames()

add

public void add(ServerName sn)
Adds the server to the dead server list if it's not there already.

Parameters:
sn - the server name

finish

public void finish(ServerName sn)

size

public int size()

isEmpty

public boolean isEmpty()

cleanAllPreviousInstances

public void cleanAllPreviousInstances(ServerName newServerName)

toString

public String toString()
Overrides:
toString in class Object

copyDeadServersSince

public List<Pair<ServerName,Long>> copyDeadServersSince(long ts)
Extract all the servers dead since a given time, and sort them.

Parameters:
ts - the time, 0 for all
Returns:
a sorted array list, by death time, lowest values first.

getTimeOfDeath

public Date getTimeOfDeath(ServerName deadServerName)
Get the time when a server died

Parameters:
deadServerName - the dead server name
Returns:
the date when the server died


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.