org.apache.hadoop.hbase.master
Class ClusterStatusPublisher

java.lang.Object
  extended by org.apache.hadoop.hbase.util.HasThread
      extended by org.apache.hadoop.hbase.Chore
          extended by org.apache.hadoop.hbase.master.ClusterStatusPublisher
All Implemented Interfaces:
Runnable

@InterfaceAudience.Private
public class ClusterStatusPublisher
extends Chore

Class to publish the cluster status to the client. This allows them to know immediately the dead region servers, hence to cut the connection they have with them, eventually stop waiting on the socket. This improves the mean time to recover, and as well allows to increase on the client the different timeouts, as the dead servers will be detected separately.


Nested Class Summary
static class ClusterStatusPublisher.MulticastPublisher
           
static interface ClusterStatusPublisher.Publisher
           
 
Field Summary
static int DEFAULT_STATUS_PUBLISH_PERIOD
           
static Class<? extends ClusterStatusPublisher.Publisher> DEFAULT_STATUS_PUBLISHER_CLASS
           
static int MAX_SERVER_PER_MESSAGE
          We want to limit the size of the protobuf message sent, do fit into a single packet.
static int NB_SEND
          If a server dies, we're sending the information multiple times in case a receiver misses the message.
static String STATUS_PUBLISH_PERIOD
          The minimum time between two status messages, in milliseconds.
static String STATUS_PUBLISHER_CLASS
          The implementation class used to publish the status.
 
Fields inherited from class org.apache.hadoop.hbase.Chore
stopper
 
Constructor Summary
protected ClusterStatusPublisher()
           
  ClusterStatusPublisher(HMaster master, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusPublisher.Publisher> publisherClass)
           
 
Method Summary
protected  void chore()
          Look for chores.
protected  void cleanup()
          Called when the chore has completed, allowing subclasses to cleanup any extra overhead
protected  List<ServerName> generateDeadServersListToSend()
          Create the dead server to send.
protected  List<Pair<ServerName,Long>> getDeadServers(long since)
          Get the servers which died since a given timestamp.
 
Methods inherited from class org.apache.hadoop.hbase.Chore
choreForTesting, initialChore, run, sleep, triggerNow
 
Methods inherited from class org.apache.hadoop.hbase.util.HasThread
getName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_PUBLISHER_CLASS

public static final String STATUS_PUBLISHER_CLASS
The implementation class used to publish the status. Default is null (no publish). Use org.apache.hadoop.hbase.master.ClusterStatusPublisher.MulticastPublisher to multicast the status.

See Also:
Constant Field Values

DEFAULT_STATUS_PUBLISHER_CLASS

public static final Class<? extends ClusterStatusPublisher.Publisher> DEFAULT_STATUS_PUBLISHER_CLASS

STATUS_PUBLISH_PERIOD

public static final String STATUS_PUBLISH_PERIOD
The minimum time between two status messages, in milliseconds.

See Also:
Constant Field Values

DEFAULT_STATUS_PUBLISH_PERIOD

public static final int DEFAULT_STATUS_PUBLISH_PERIOD
See Also:
Constant Field Values

MAX_SERVER_PER_MESSAGE

public static final int MAX_SERVER_PER_MESSAGE
We want to limit the size of the protobuf message sent, do fit into a single packet. a reasonable size for ip / ethernet is less than 1Kb.

See Also:
Constant Field Values

NB_SEND

public static final int NB_SEND
If a server dies, we're sending the information multiple times in case a receiver misses the message.

See Also:
Constant Field Values
Constructor Detail

ClusterStatusPublisher

public ClusterStatusPublisher(HMaster master,
                              org.apache.hadoop.conf.Configuration conf,
                              Class<? extends ClusterStatusPublisher.Publisher> publisherClass)
                       throws IOException
Throws:
IOException

ClusterStatusPublisher

protected ClusterStatusPublisher()
Method Detail

chore

protected void chore()
Description copied from class: Chore
Look for chores. If any found, do them else just return.

Specified by:
chore in class Chore

cleanup

protected void cleanup()
Description copied from class: Chore
Called when the chore has completed, allowing subclasses to cleanup any extra overhead

Overrides:
cleanup in class Chore

generateDeadServersListToSend

protected List<ServerName> generateDeadServersListToSend()
Create the dead server to send. A dead server is sent NB_SEND times. We send at max MAX_SERVER_PER_MESSAGE at a time. if there are too many dead servers, we send the newly dead first.


getDeadServers

protected List<Pair<ServerName,Long>> getDeadServers(long since)
Get the servers which died since a given timestamp. protected because it can be subclassed by the tests.



Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.