Package org.apache.hadoop.hbase.client
Class ClusterStatusListener
java.lang.Object
org.apache.hadoop.hbase.client.ClusterStatusListener
- All Implemented Interfaces:
Closeable
,AutoCloseable
A class that receives the cluster status, and provide it as a set of service to the client.
Today, manages only the dead server list. The class is abstract to allow multiple
implementations, from ZooKeeper to multicast based.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Class to be extended to manage a new dead server.(package private) static interface
The interface to be implemented by a listener of a cluster status event.(package private) class
An implementation using a multicast message between the master & the client. -
Field Summary
Modifier and TypeFieldDescriptionprotected final ClusterStatusListener.DeadServerHandler
private final List<ServerName>
static final Class<? extends ClusterStatusListener.Listener>
private final ClusterStatusListener.Listener
private static final org.slf4j.Logger
static final String
The implementation class to use to read the status. -
Constructor Summary
ConstructorDescriptionClusterStatusListener
(ClusterStatusListener.DeadServerHandler dsh, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusListener.Listener> listenerClass) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
Check if we know if a server is dead.void
receive
(ClusterMetrics ncs) Acts upon the reception of a new cluster status.
-
Field Details
-
LOG
-
deadServers
-
deadServerHandler
-
listener
-
STATUS_LISTENER_CLASS
The implementation class to use to read the status.- See Also:
-
DEFAULT_STATUS_LISTENER_CLASS
-
-
Constructor Details
-
ClusterStatusListener
public ClusterStatusListener(ClusterStatusListener.DeadServerHandler dsh, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusListener.Listener> listenerClass) throws IOException - Throws:
IOException
-
-
Method Details
-
receive
Acts upon the reception of a new cluster status.- Parameters:
ncs
- the cluster status
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
isDeadServer
Check if we know if a server is dead.- Parameters:
sn
- the server name to check.- Returns:
- true if we know for sure that the server is dead, false otherwise.
-