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
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static classAn InvocationHandler that simply passes through calls to the original object.private static classThis 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
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final longstatic final longstatic final Stringprivate final longprivate static TaskMonitorprivate static final org.slf4j.Loggerstatic final Stringprivate final intstatic final Stringprivate final longprivate Threadstatic final Stringprivate final List<TaskMonitor.TaskAndWeakRefPair>private final longprivate final org.apache.hbase.thirdparty.org.apache.commons.collections4.queue.CircularFifoQueue<TaskMonitor.TaskAndWeakRefPair> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancanPurge(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.TaskFiltercreateTaskFilter(String filter) Create a task filter according to a given filter type.static TaskGroupcreateTaskGroup(boolean ignoreSubTasksInTaskMonitor, String description) Create a task group which contains a series of monitored tasks for users to inquire about the statusvoiddumpAsText(PrintWriter out) static TaskMonitorget()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 voidprocessTasks(Iterable<TaskMonitor.TaskAndWeakRefPair> tasks, TaskMonitor.TaskFilter filter, List<MonitoredTask> results) private voidvoidshutdown()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 theTaskMonitorenableJournal- 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 theTaskMonitordescription- 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
-