Class TaskMonitor
java.lang.Object
org.apache.hadoop.hbase.monitoring.TaskMonitor
Singleton which keeps track of tasks going on in this VM. A Task here is anything which takes
more than a few seconds and the user might want to inquire about the status
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate class
private static class
An InvocationHandler that simply passes through calls to the original object.private static class
This class encapsulates an object as well as a weak reference to a proxy that passes through calls to that object.private static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
static final int
static final long
static final long
static final String
private final long
private static TaskMonitor
private static final org.slf4j.Logger
static final String
private final int
static final String
private final long
private Thread
static final String
private final List<TaskMonitor.TaskAndWeakRefPair>
private final long
private final org.apache.hbase.thirdparty.org.apache.commons.collections4.queue.CircularFifoQueue<TaskMonitor.TaskAndWeakRefPair>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
canPurge
(MonitoredTask stat) createRPCStatus
(String description) createStatus
(String description) createStatus
(String description, boolean ignore) createStatus
(String description, boolean ignore, boolean enableJournal) Create a monitored task for users to inquire about the statusprivate static TaskMonitor.TaskFilter
createTaskFilter
(String filter) Create a task filter according to a given filter type.static TaskGroup
createTaskGroup
(boolean ignoreSubTasksInTaskMonitor, String description) Create a task group which contains a series of monitored tasks for users to inquire about the statusvoid
dumpAsText
(PrintWriter out) static TaskMonitor
get()
Get singleton instance.getTasks()
Produces a list containing copies of the current state of all non-expired MonitoredTasks handled by this TaskMonitor.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
void
shutdown()
private void
-
Field Details
-
LOG
-
MAX_TASKS_KEY
- See Also:
-
DEFAULT_MAX_TASKS
- See Also:
-
RPC_WARN_TIME_KEY
- See Also:
-
DEFAULT_RPC_WARN_TIME
- See Also:
-
EXPIRATION_TIME_KEY
- See Also:
-
DEFAULT_EXPIRATION_TIME
- See Also:
-
MONITOR_INTERVAL_KEY
- See Also:
-
DEFAULT_MONITOR_INTERVAL
- See Also:
-
instance
-
maxTasks
-
rpcWarnTime
-
expirationTime
-
tasks
private final org.apache.hbase.thirdparty.org.apache.commons.collections4.queue.CircularFifoQueue<TaskMonitor.TaskAndWeakRefPair> tasks -
rpcTasks
-
monitorInterval
-
monitorThread
-
-
Constructor Details
-
TaskMonitor
TaskMonitor(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
get
Get singleton instance. TODO this would be better off scoped to a single daemon -
createStatus
-
createStatus
-
createStatus
Create a monitored task for users to inquire about the status- Parameters:
description
- description of the statusignore
- whether to ignore to track(e.g. show/clear/expire) the task in theTaskMonitor
enableJournal
- enable when the task contains some stage journals- Returns:
- a monitored task
-
createTaskGroup
Create a task group which contains a series of monitored tasks for users to inquire about the status- Parameters:
ignoreSubTasksInTaskMonitor
- whether to ignore to track(e.g. show/clear/expire) the task in theTaskMonitor
description
- description of the status- Returns:
- a group of monitored tasks
-
createRPCStatus
-
warnStuckTasks
-
purgeExpiredTasks
-
getTasks
Produces a list containing copies of the current state of all non-expired MonitoredTasks handled by this TaskMonitor.- Returns:
- A complete list of MonitoredTasks.
-
getTasks
Produces a list containing copies of the current state of all non-expired MonitoredTasks handled by this TaskMonitor.- Parameters:
filter
- type of wanted tasks- Returns:
- A filtered list of MonitoredTasks.
-
createTaskFilter
Create a task filter according to a given filter type.- Parameters:
filter
- type of monitored task- Returns:
- a task filter
-
processTasks
private static void processTasks(Iterable<TaskMonitor.TaskAndWeakRefPair> tasks, TaskMonitor.TaskFilter filter, List<MonitoredTask> results) -
canPurge
-
dumpAsText
-
shutdown
-