@InterfaceAudience.Private class MonitoredTaskImpl extends Object implements MonitoredTask
Modifier and Type | Class and Description |
---|---|
private static class |
MonitoredTaskImpl.StatusJournalEntryImpl |
MonitoredTask.State, MonitoredTask.StatusJournalEntry
Modifier and Type | Field and Description |
---|---|
private String |
description |
private List<MonitoredTask.StatusJournalEntry> |
journal |
private boolean |
journalEnabled |
private static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
private long |
startTime |
protected MonitoredTask.State |
state |
private long |
stateTime |
private String |
status |
private long |
statusTime |
private long |
warnTime |
Constructor and Description |
---|
MonitoredTaskImpl() |
Modifier and Type | Method and Description |
---|---|
void |
abort(String msg) |
void |
cleanup()
Explicitly mark this status as able to be cleaned up,
even though it might not be complete.
|
MonitoredTaskImpl |
clone()
Public exposure of Object.clone() in order to allow clients to easily
capture current state.
|
void |
disableStatusJournal() |
void |
enableStatusJournal(boolean includeCurrentStatus)
Enables journaling of this monitored task, the first invocation will lazily initialize the
journal.
|
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() |
long |
getWarnTime() |
void |
markComplete(String status) |
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() |
private long startTime
private long statusTime
private long stateTime
private long warnTime
private volatile String description
protected volatile MonitoredTask.State state
private boolean journalEnabled
private List<MonitoredTask.StatusJournalEntry> journal
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
public MonitoredTaskImpl()
public MonitoredTaskImpl clone()
MonitoredTask
clone
in interface MonitoredTask
clone
in class Object
public long getStartTime()
getStartTime
in interface MonitoredTask
public String getDescription()
getDescription
in interface MonitoredTask
public String getStatus()
getStatus
in interface MonitoredTask
public long getStatusTime()
getStatusTime
in interface MonitoredTask
public MonitoredTask.State getState()
getState
in interface MonitoredTask
public long getStateTime()
getStateTime
in interface MonitoredTask
public long getWarnTime()
getWarnTime
in interface MonitoredTask
public long getCompletionTimestamp()
getCompletionTimestamp
in interface MonitoredTask
public void markComplete(String status)
markComplete
in interface MonitoredTask
public void pause(String msg)
pause
in interface MonitoredTask
public void resume(String msg)
resume
in interface MonitoredTask
public void abort(String msg)
abort
in interface MonitoredTask
public void setStatus(String status)
setStatus
in interface MonitoredTask
protected void setState(MonitoredTask.State state)
public void setDescription(String description)
setDescription
in interface MonitoredTask
public void setWarnTime(long t)
setWarnTime
in interface MonitoredTask
public void cleanup()
MonitoredTask
cleanup
in interface MonitoredTask
public void expireNow()
expireNow
in interface MonitoredTask
public Map<String,Object> toMap()
MonitoredTask
toMap
in interface MonitoredTask
public String toJSON() throws IOException
MonitoredTask
toJSON
in interface MonitoredTask
IOException
public List<MonitoredTask.StatusJournalEntry> getStatusJournal()
getStatusJournal
in interface MonitoredTask
public void enableStatusJournal(boolean includeCurrentStatus)
enableStatusJournal
in interface MonitoredTask
includeCurrentStatus
- whether to include the current set status in the journalpublic void disableStatusJournal()
disableStatusJournal
in interface MonitoredTask
public String prettyPrintJournal()
prettyPrintJournal
in interface MonitoredTask
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.