@InterfaceAudience.Private public class TaskGroup extends Object
TaskGroup can be seen as a big MonitoredTask, which contains a list of sub
monitored tasks. The monitored tasks in the group are still be managed by the
TaskMonitor, but whether to clear/expire the monitored tasks in a task group is optional.
Since the monitored task already has journals, which mark the phases in a task, we still also
need a task group to monitor a big task/process because the journals in a task is serial but the
tasks in the task group can be parallel, then we have more flexible ability to monitor the
process. Grouping the tasks is not strictly necessary but it is cleaner for presentation to
operators. We might want to display the tasks in a group in a list view where each task can be
collapsed (probably by default) or expanded.MonitoredTask.State, MonitoredTask.StatusJournalEntry| Modifier and Type | Field and Description |
|---|---|
protected MonitoredTask.State |
state |
| Constructor and Description |
|---|
TaskGroup(boolean ignoreSubTasksInTaskMonitor,
String description) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String msg) |
MonitoredTask |
addTask(String description) |
MonitoredTask |
addTask(String description,
boolean withCompleteLast)
Add a new task to the group, and before that might complete the last task in the group
|
void |
cleanup()
Explicitly mark this status as able to be cleaned up, even though it might not be complete.
|
org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl |
clone()
Public exposure of Object.clone() in order to allow clients to easily capture current state.
|
void |
expireNow()
Force the completion timestamp backwards so that it expires now.
|
long |
getCompletionTimestamp() |
String |
getDescription() |
long |
getStartTime() |
MonitoredTask.State |
getState() |
long |
getStateTime() |
String |
getStatus() |
List<MonitoredTask.StatusJournalEntry> |
getStatusJournal()
Returns the status journal.
|
long |
getStatusTime() |
Collection<MonitoredTask> |
getTasks() |
long |
getWarnTime() |
void |
markComplete(String msg) |
void |
pause(String msg) |
String |
prettyPrintJournal() |
void |
resume(String msg) |
void |
setDescription(String description) |
protected void |
setState(MonitoredTask.State state) |
void |
setStatus(String status) |
void |
setWarnTime(long t) |
String |
toJSON()
Creates a JSON object for parseable exposure of monitored tasks.
|
Map<String,Object> |
toMap()
Creates a string map of internal details for extensible exposure of monitored tasks.
|
String |
toString() |
protected volatile MonitoredTask.State state
public TaskGroup(boolean ignoreSubTasksInTaskMonitor,
String description)
public MonitoredTask addTask(String description)
public MonitoredTask addTask(String description, boolean withCompleteLast)
description - the description of the new taskwithCompleteLast - whether to complete the last task in the grouppublic Collection<MonitoredTask> getTasks()
public void abort(String msg)
abort in interface MonitoredTaskpublic void markComplete(String msg)
markComplete in interface MonitoredTaskpublic void cleanup()
MonitoredTaskcleanup in interface MonitoredTaskpublic org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl clone()
MonitoredTaskclone in interface MonitoredTaskclone in class Objectpublic long getStartTime()
getStartTime in interface MonitoredTaskpublic String getDescription()
getDescription in interface MonitoredTaskpublic String getStatus()
getStatus in interface MonitoredTaskpublic long getStatusTime()
getStatusTime in interface MonitoredTaskpublic MonitoredTask.State getState()
getState in interface MonitoredTaskpublic long getStateTime()
getStateTime in interface MonitoredTaskpublic long getWarnTime()
getWarnTime in interface MonitoredTaskpublic long getCompletionTimestamp()
getCompletionTimestamp in interface MonitoredTaskpublic void pause(String msg)
pause in interface MonitoredTaskpublic void resume(String msg)
resume in interface MonitoredTaskpublic void setStatus(String status)
setStatus in interface MonitoredTaskprotected void setState(MonitoredTask.State state)
public void setDescription(String description)
setDescription in interface MonitoredTaskpublic void setWarnTime(long t)
setWarnTime in interface MonitoredTaskpublic void expireNow()
expireNow in interface MonitoredTaskpublic Map<String,Object> toMap()
MonitoredTasktoMap in interface MonitoredTaskpublic String toJSON() throws IOException
MonitoredTasktoJSON in interface MonitoredTaskIOExceptionpublic List<MonitoredTask.StatusJournalEntry> getStatusJournal()
getStatusJournal in interface MonitoredTaskpublic String prettyPrintJournal()
prettyPrintJournal in interface MonitoredTaskCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.