public class TaskResultImpl extends Object implements TaskResult
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
logger |
Constructor and Description |
---|
TaskResultImpl(TaskId id) |
TaskResultImpl(TaskId id,
byte[] serializedValue,
byte[] serializedException,
TaskLogs output,
boolean isRaw) |
TaskResultImpl(TaskId id,
byte[] serializedValue,
byte[] serializedException,
TaskLogs output,
Map<String,String> metadata,
Map<String,byte[]> propagatedVariables,
boolean isRaw) |
TaskResultImpl(TaskId id,
Serializable value,
TaskLogs output,
long execDuration)
Return a new instance of task result represented by a task id, its result and its output.
|
TaskResultImpl(TaskId id,
Throwable exception) |
TaskResultImpl(TaskId id,
Throwable exception,
TaskLogs output,
long execDuration)
Return a new instance of task result represented by a task id and its exception.
|
Modifier and Type | Method and Description |
---|---|
FlowAction |
getAction()
If a FlowScript was executed on this task, its result
is stored so that the action can be performed later when
processed by the core.
|
Throwable |
getException()
Retrieve the exception threw by the task.
|
String |
getExceptionMessage()
Return the exception message, if any, used by dozer mappings.
|
Map<String,String> |
getMetadata()
Get metadata associated with this result.
|
TaskLogs |
getOutput()
Return the output of the execution, including stdout and stderr.
|
String |
getPreviewerClassName()
Get the previewerClassName.
|
Map<String,byte[]> |
getPropagatedVariables()
Returns a map of propagated variables.
|
Map<String,Serializable> |
getResultMap()
Returns a map of job results
|
byte[] |
getSerializedException()
Get the serializedException.
|
byte[] |
getSerializedValue()
Get the serializedValue.
|
long |
getTaskDuration()
Get the real task duration.
|
TaskId |
getTaskId()
To get the id of the task.
|
Serializable |
getValue()
Get the value of the task.
|
Map<String,Serializable> |
getVariables()
Returns the deserialized version of the propagated variables
|
boolean |
hadException()
To know if an exception has occurred on this task.
|
boolean |
isRaw()
Returns true if this result contains raw data (i.e.
|
void |
setAction(FlowAction act)
If a FlowScript was executed on this task, its result
is stored so that the action can be performed later when
processed by the core.
|
void |
setException(Throwable ex) |
void |
setLogs(TaskLogs l) |
void |
setMetadata(Map<String,String> metadata) |
void |
setPreviewerClassName(String descClass)
Set the class that is able to describe this result.
|
void |
setPropagatedVariables(Map<String,byte[]> propagatedVariables)
Sets the propagated variables.
|
void |
setResultMap(Map<String,Serializable> resultMap) |
String |
toString() |
Serializable |
value()
Get the value of the task.
|
public TaskResultImpl(TaskId id, byte[] serializedValue, byte[] serializedException, TaskLogs output, Map<String,String> metadata, Map<String,byte[]> propagatedVariables, boolean isRaw)
public TaskResultImpl(TaskId id, byte[] serializedValue, byte[] serializedException, TaskLogs output, boolean isRaw)
public TaskResultImpl(TaskId id)
public TaskResultImpl(TaskId id, Serializable value, TaskLogs output, long execDuration)
id
- the identification of the task that send this result.value
- the result of the task.output
- the output of the task.execDuration
- the execution duration of the task itselfpublic TaskResultImpl(TaskId id, Throwable exception, TaskLogs output, long execDuration)
id
- the identification of the task that send this result.exception
- the exception that occurred in the task.output
- the output of the task.execDuration
- the execution duration of the task itselfpublic FlowAction getAction()
getAction
in interface TaskResult
public void setAction(FlowAction act)
act
- an Control Flow action to embed in this TaskResultpublic void setLogs(TaskLogs l)
l
- logs of the taskpublic boolean hadException()
TaskResult
hadException
in interface TaskResult
TaskResult.hadException()
public void setException(Throwable ex)
public TaskId getTaskId()
TaskResult
getTaskId
in interface TaskResult
TaskResult.getTaskId()
public Serializable value() throws Throwable
TaskResult
value
in interface TaskResult
Throwable
- If the value has generate an exception.TaskResult.value()
public Serializable getValue() throws Throwable
TaskResult
getValue
in interface TaskResult
Throwable
public Throwable getException()
TaskResult
getException
in interface TaskResult
TaskResult.getException()
public String getExceptionMessage()
public void setPreviewerClassName(String descClass)
descClass
- the name of the class that is able to describe this result.public byte[] getSerializedValue()
getSerializedValue
in interface TaskResult
public Map<String,String> getMetadata()
TaskResult
getMetadata
in interface TaskResult
public byte[] getSerializedException()
public TaskLogs getOutput()
TaskResult
getOutput
in interface TaskResult
TaskResult.getOutput()
public String getPreviewerClassName()
public long getTaskDuration()
public String toString()
toString
in class Object
Object.toString()
public void setPropagatedVariables(Map<String,byte[]> propagatedVariables)
propagatedVariables
- a map of propagated variablespublic Map<String,byte[]> getPropagatedVariables()
getPropagatedVariables
in interface TaskResult
public Map<String,Serializable> getVariables() throws IOException, ClassNotFoundException
TaskResult
getVariables
in interface TaskResult
IOException
ClassNotFoundException
public boolean isRaw()
TaskResult
isRaw
in interface TaskResult
public Map<String,Serializable> getResultMap()
TaskResult
getResultMap
in interface TaskResult
public void setResultMap(Map<String,Serializable> resultMap)