V
- the result type.public interface TaskDescriptor<V extends Serializable> extends Serializable
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Return the description of the task passed when it was created.
|
long |
getElapsedRunTime()
This returns number of milliseconds the task has been running for.
|
Date |
getFinishedTimestamp()
Return the date when the task was finished.
|
String |
getNodeId()
Returns node id from where task was submitted
|
String |
getProgressURL()
Returns the URL that displays progress on this task.
|
V |
getResult()
This returns the result of the long running task.
|
SpanningOperation |
getSpanningOperation()
Return operation that this task is part of.
|
Date |
getStartedTimestamp()
Return the date when the task was started.
|
Date |
getSubmittedTimestamp()
Return the date when the task was submitted.
|
TaskContext |
getTaskContext()
Return the context of task.
|
Long |
getTaskId()
Return the identifier for this task.
|
TaskProgressIndicator |
getTaskProgressIndicator()
Return the
TaskProgressIndicator associated with the task. |
String |
getUserName()
Return the user that started to task.
|
boolean |
isCancellable()
Returns whether this supports requests to cancel it.
|
boolean |
isCancelled()
Returns whether cancellation of task has been requested.
|
boolean |
isFinished()
Tells if caller if the task has finished running or not.
|
boolean |
isSelfRecovering()
Returns whether the task will be automatically picked up again by the cluster if the node
that was executing it crashes.
|
boolean |
isStarted()
True if the task has been started.
|
void |
setCancelled(boolean cancelled)
Set flag to indicate this task has been cancelled;
|
void |
setResult(V result)
Store the result in the descriptor.
|
V getResult()
boolean isStarted()
boolean isFinished()
Long getTaskId()
Date getStartedTimestamp()
null
will be returned if the task has not started executing.Date getFinishedTimestamp()
null
will be returned if the task has not finished
executing.Date getSubmittedTimestamp()
TaskManager
. A null
value will never be returned as the task will always have a submission time.long getElapsedRunTime()
String getUserName()
String getDescription()
TaskContext getTaskContext()
null
as a task must always
have a context.String getProgressURL()
TaskContext
.null
cannot be returned.TaskProgressIndicator getTaskProgressIndicator()
TaskProgressIndicator
associated with the task. A task will only have an indicator if its
callable implements the ProvidesTaskProgress
interface.TaskProgressIndicator
associated with the task or null
if there isn't one.boolean isCancellable()
true
if cancellation is supported,
and false
otherwiseboolean isCancelled()
true
if cancellation has been requested,
and false
otherwisevoid setCancelled(boolean cancelled)
cancelled
- Cancelled flagboolean isSelfRecovering()
Used by Jira to determine which tasks it should clean up after detecting such crashed node.
SelfRecovering
void setResult(V result)
result
- The ResultString getNodeId()
@Nullable SpanningOperation getSpanningOperation()
Copyright © 2002-2021 Atlassian. All Rights Reserved.