@InterfaceAudience.Private public class TaskMonitor extends Object
Modifier and Type | Class and Description |
---|---|
private class |
TaskMonitor.MonitorRunnable |
private static class |
TaskMonitor.PassthroughInvocationHandler<T>
An InvocationHandler that simply passes through calls to the original object.
|
private static class |
TaskMonitor.TaskAndWeakRefPair
This class encapsulates an object as well as a weak reference to a proxy that passes through
calls to that object.
|
private static interface |
TaskMonitor.TaskFilter |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_EXPIRATION_TIME |
static int |
DEFAULT_MAX_TASKS |
static long |
DEFAULT_MONITOR_INTERVAL |
static long |
DEFAULT_RPC_WARN_TIME |
static String |
EXPIRATION_TIME_KEY |
private long |
expirationTime |
private static TaskMonitor |
instance |
private static org.slf4j.Logger |
LOG |
static String |
MAX_TASKS_KEY |
private int |
maxTasks |
static String |
MONITOR_INTERVAL_KEY |
private long |
monitorInterval |
private Thread |
monitorThread |
static String |
RPC_WARN_TIME_KEY |
private List<TaskMonitor.TaskAndWeakRefPair> |
rpcTasks |
private long |
rpcWarnTime |
private org.apache.hbase.thirdparty.org.apache.commons.collections4.queue.CircularFifoQueue<TaskMonitor.TaskAndWeakRefPair> |
tasks |
Constructor and Description |
---|
TaskMonitor(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
private boolean |
canPurge(MonitoredTask stat) |
MonitoredRPCHandler |
createRPCStatus(String description) |
MonitoredTask |
createStatus(String description) |
MonitoredTask |
createStatus(String description,
boolean enableJournal) |
private static TaskMonitor.TaskFilter |
createTaskFilter(String filter)
Create a task filter according to a given filter type.
|
void |
dumpAsText(PrintWriter out) |
static TaskMonitor |
get()
Get singleton instance.
|
List<MonitoredTask> |
getTasks()
Produces a list containing copies of the current state of all non-expired MonitoredTasks
handled by this TaskMonitor.
|
List<MonitoredTask> |
getTasks(String filter)
Produces a list containing copies of the current state of all non-expired MonitoredTasks
handled by this TaskMonitor.
|
private static void |
processTasks(Iterable<TaskMonitor.TaskAndWeakRefPair> tasks,
TaskMonitor.TaskFilter filter,
List<MonitoredTask> results) |
private void |
purgeExpiredTasks() |
void |
shutdown() |
private void |
warnStuckTasks() |
private static final org.slf4j.Logger LOG
public static final String MAX_TASKS_KEY
public static final int DEFAULT_MAX_TASKS
public static final String RPC_WARN_TIME_KEY
public static final long DEFAULT_RPC_WARN_TIME
public static final String EXPIRATION_TIME_KEY
public static final long DEFAULT_EXPIRATION_TIME
public static final String MONITOR_INTERVAL_KEY
public static final long DEFAULT_MONITOR_INTERVAL
private static TaskMonitor instance
private final int maxTasks
private final long rpcWarnTime
private final long expirationTime
private final org.apache.hbase.thirdparty.org.apache.commons.collections4.queue.CircularFifoQueue<TaskMonitor.TaskAndWeakRefPair> tasks
private final List<TaskMonitor.TaskAndWeakRefPair> rpcTasks
private final long monitorInterval
private Thread monitorThread
TaskMonitor(org.apache.hadoop.conf.Configuration conf)
public static TaskMonitor get()
public MonitoredTask createStatus(String description)
public MonitoredTask createStatus(String description, boolean enableJournal)
public MonitoredRPCHandler createRPCStatus(String description)
private void warnStuckTasks()
private void purgeExpiredTasks()
public List<MonitoredTask> getTasks()
public List<MonitoredTask> getTasks(String filter)
filter
- type of wanted tasksprivate static TaskMonitor.TaskFilter createTaskFilter(String filter)
filter
- type of monitored taskprivate static void processTasks(Iterable<TaskMonitor.TaskAndWeakRefPair> tasks, TaskMonitor.TaskFilter filter, List<MonitoredTask> results)
private boolean canPurge(MonitoredTask stat)
public void dumpAsText(PrintWriter out)
public void shutdown()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.