Package org.apache.hadoop.hbase.master
Class ClusterStatusPublisher
java.lang.Object
org.apache.hadoop.hbase.ScheduledChore
org.apache.hadoop.hbase.master.ClusterStatusPublisher
- All Implemented Interfaces:
Runnable
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
Modifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
static final int
static final Class<? extends ClusterStatusPublisher.Publisher>
private long
private final ConcurrentMap<ServerName,
Integer> private static org.slf4j.Logger
private final HMaster
static final int
We want to limit the size of the protobuf message sent, do fit into a single packet.private final int
static final int
If a server dies, we're sending the information multiple times in case a receiver misses the message.private ClusterStatusPublisher.Publisher
static final String
The minimum time between two status messages, in milliseconds.static final String
The implementation class used to publish the status. -
Constructor Summary
ModifierConstructorDescriptionprotected
ClusterStatusPublisher
(HMaster master, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusPublisher.Publisher> publisherClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
chore()
The task to execute on each scheduled execution of the Choreprotected void
cleanup()
Override to run cleanup tasks when the Chore encounters an error and must stop runningprotected List<ServerName>
Create the dead server to send.protected List<Pair<ServerName,
Long>> getDeadServers
(long since) Get the servers which died since a given timestamp.private boolean
toString()
A summation of this chore in human readable format.Methods inherited from class org.apache.hadoop.hbase.ScheduledChore
cancel, cancel, choreForTesting, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, shutdown, shutdown, triggerNow
-
Field Details
-
LOG
-
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:
-
DEFAULT_STATUS_PUBLISHER_CLASS
public static final Class<? extends ClusterStatusPublisher.Publisher> DEFAULT_STATUS_PUBLISHER_CLASS -
STATUS_PUBLISH_PERIOD
The minimum time between two status messages, in milliseconds.- See Also:
-
DEFAULT_STATUS_PUBLISH_PERIOD
- See Also:
-
lastMessageTime
-
master
-
messagePeriod
-
lastSent
-
publisher
-
connected
-
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:
-
NB_SEND
If a server dies, we're sending the information multiple times in case a receiver misses the message.- See Also:
-
-
Constructor Details
-
ClusterStatusPublisher
public ClusterStatusPublisher(HMaster master, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusPublisher.Publisher> publisherClass) throws IOException - Throws:
IOException
-
ClusterStatusPublisher
protected ClusterStatusPublisher()
-
-
Method Details
-
toString
Description copied from class:ScheduledChore
A summation of this chore in human readable format. Downstream users should not presume parsing of this string can relaibly be done between versions. Instead, they should rely on the public accessor methods to get the information they desire.- Overrides:
toString
in classScheduledChore
-
chore
Description copied from class:ScheduledChore
The task to execute on each scheduled execution of the Chore- Specified by:
chore
in classScheduledChore
-
cleanup
Description copied from class:ScheduledChore
Override to run cleanup tasks when the Chore encounters an error and must stop running- Overrides:
cleanup
in classScheduledChore
-
isConnected
-
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
Get the servers which died since a given timestamp. protected because it can be subclassed by the tests.
-