@InterfaceAudience.Private class ClusterStatusListener extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
ClusterStatusListener.DeadServerHandler
Class to be extended to manage a new dead server.
|
(package private) static interface |
ClusterStatusListener.Listener
The interface to be implemented by a listener of a cluster status event.
|
(package private) class |
ClusterStatusListener.MulticastListener
An implementation using a multicast message between the master & the client.
|
Modifier and Type | Field and Description |
---|---|
protected ClusterStatusListener.DeadServerHandler |
deadServerHandler |
private List<ServerName> |
deadServers |
static Class<? extends ClusterStatusListener.Listener> |
DEFAULT_STATUS_LISTENER_CLASS |
private ClusterStatusListener.Listener |
listener |
private static org.slf4j.Logger |
LOG |
static String |
STATUS_LISTENER_CLASS
The implementation class to use to read the status.
|
Constructor and Description |
---|
ClusterStatusListener(ClusterStatusListener.DeadServerHandler dsh,
org.apache.hadoop.conf.Configuration conf,
Class<? extends ClusterStatusListener.Listener> listenerClass) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isDeadServer(ServerName sn)
Check if we know if a server is dead.
|
void |
receive(ClusterMetrics ncs)
Acts upon the reception of a new cluster status.
|
private static final org.slf4j.Logger LOG
private final List<ServerName> deadServers
protected final ClusterStatusListener.DeadServerHandler deadServerHandler
private final ClusterStatusListener.Listener listener
public static final String STATUS_LISTENER_CLASS
public static final Class<? extends ClusterStatusListener.Listener> DEFAULT_STATUS_LISTENER_CLASS
public ClusterStatusListener(ClusterStatusListener.DeadServerHandler dsh, org.apache.hadoop.conf.Configuration conf, Class<? extends ClusterStatusListener.Listener> listenerClass) throws IOException
IOException
public void receive(ClusterMetrics ncs)
ncs
- the cluster statuspublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean isDeadServer(ServerName sn)
sn
- the server name to check.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.