Package org.pentaho.di.core
Class Result
java.lang.Object
org.pentaho.di.core.Result
- All Implemented Interfaces:
Cloneable
Describes the result of the execution of a Transformation or a Job. The information available includes the following:
- Number of errors the job or transformation encountered
- Number of lines input
- Number of lines output
- Number of lines updated
- Number of lines read
- Number of lines written
- Number of lines deleted
- Number of lines rejected
- Number of files retrieved
- Boolean result of the execution
- Exit status value
- Whether the transformation was stopped
- Logging information (channel ID and text) After execution of a job or transformation, the Result can be evaluated.
- Since:
- 05-11-2003
- Author:
- Matt
-
Field Summary
Modifier and TypeFieldDescriptionboolean
Whether the job or transformation was stopped.static final String
A constant specifying the tag value for the XML node for the result file entrystatic final String
A constant specifying the tag value for the XML node for result files entrystatic final String
A constant specifying the tag value for the XML node for the result rows entrystatic final String
A constant specifying the tag value for the XML node of the result object -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the numbers of lines from a different result to this resultvoid
appendLogText
(String logTextStr) void
clear()
Clears the numbers in this result, setting them all to zero.clone()
Clones the Result, including rows and files.long
Returns the elapsed time of the ETL execution in millisecondslong
Returns the entry numberReturns the unique identifier of an ETL execution, should one ever care to declare one suchint
Returns the exit status value.Returns the log channel id of the object that was executed (trans, job, job entry, etc)Returns all the text from any logging performed by the transformation or joblong
Returns the number of errors that occurred during this transformation or joblong
Returns the number of files retrieved during execution of this transformation or joblong
Returns the number of lines deleted during execution of this transformation or joblong
Returns the number of lines input during execution of this transformation or joblong
Returns the number of lines output during execution of this transformation or joblong
Returns the number of lines read during execution of this transformation or joblong
Returns the number of lines rejected during execution of this transformation or joblong
Returns the number of lines updated during execution of this transformation or joblong
Returns the number of lines written during execution of this transformation or jobgetReadWriteThroughput
(int seconds) Creates a string containing the read/write throughput.boolean
Returns the boolean result of this transformation or jobReturns the result files as a Map with the filename as key and the ResultFile object as valueReturns the result files as a List of type ResultFilegetRows()
Returns the resulting rowset from the job or transformation.getXML()
Returns a String object with the Result object serialized as XMLvoid
increaseErrors
(long incr) Increases the number of errors by the specified valuevoid
increaseLinesDeleted
(long incr) Increases the number of lines deleted by the specified valuevoid
increaseLinesInput
(long incr) Increases the number of lines input by the specified valuevoid
increaseLinesOutput
(long incr) Increases the number of lines output by the specified valuevoid
increaseLinesRead
(long incr) Increases the number of lines read by the specified valuevoid
increaseLinesRejected
(long incr) Increases the number of lines rejected by the specified valuevoid
increaseLinesUpdated
(long incr) Increases the number of lines updated by the specified valuevoid
increaseLinesWritten
(long incr) Increases the number of lines written by the specified valueboolean
Sets flag for safe stopping a transformationboolean
Returns whether the transformation or job was stopped before completionPerforms a semi-deep copy/clone but does not clone the rows from the Resultvoid
setElapsedTimeMillis
(long elapsedTimeMillis) Sets the elapsed time of the ETL execution in millisecondsvoid
setEntryNr
(long entryNr) Sets the entry number to the specified valuevoid
setExecutionId
(String executionId) Sets a unique identifier of an ETL execution, should one ever care to declare one suchvoid
setExitStatus
(int exitStatus) Sets the exit status value to the specified valuevoid
setLogChannelId
(String logChannelId) Sets the log channel id of the object that was executed (trans, job, job entry, etc)void
setLogText
(String logText) Sets the logging text to the specified Stringvoid
setNrErrors
(long nrErrors) Sets the number of errors that occurred during execution of this transformation or jobvoid
setNrFilesRetrieved
(long filesRetrieved) Sets the number of files retrieved to the specified valuevoid
setNrLinesDeleted
(long nrLinesDeleted) Sets the number of lines deleted during execution of this transformation or jobvoid
setNrLinesInput
(long nrLinesInput) Sets the number of lines input during execution of this transformation or jobvoid
setNrLinesOutput
(long nrLinesOutput) Sets the number of lines output during execution of this transformation or jobvoid
setNrLinesRead
(long nrLinesRead) Sets the number of lines read during execution of this transformation or jobvoid
setNrLinesRejected
(long nrLinesRejected) Sets the number of lines rejected during execution of this transformation or jobvoid
setNrLinesUpdated
(long nrLinesUpdated) Sets the number of lines updated during execution of this transformation or jobvoid
setNrLinesWritten
(long nrLinesWritten) Sets the number of lines written during execution of this transformation or jobvoid
setResult
(boolean result) Sets the result of the transformation or job.void
setResultFiles
(Map<String, ResultFile> usedFiles) Sets the result files for this Result to the specified Map of ResultFile objectsvoid
setRows
(List<RowMetaAndData> rows) Sets the resulting rowset from the job or transformation executionvoid
setSafeStop
(boolean safeStop) Returns the flag for safe stopping a transformationvoid
setStopped
(boolean stopped) Sets whether the transformation or job was stopped before completiontoString()
Returns a string representation of the Result object
-
Field Details
-
XML_TAG
A constant specifying the tag value for the XML node of the result object- See Also:
-
XML_FILES_TAG
A constant specifying the tag value for the XML node for result files entry- See Also:
-
XML_FILE_TAG
A constant specifying the tag value for the XML node for the result file entry- See Also:
-
XML_ROWS_TAG
A constant specifying the tag value for the XML node for the result rows entry- See Also:
-
stopped
public boolean stoppedWhether the job or transformation was stopped.
-
-
Constructor Details
-
Result
public Result()Instantiates a new Result object, setting default values for all members -
Result
public Result(int nr) Instantiates a new Result object, setting default values for all members and the entry number- Parameters:
nr
- the entry number for the Result
-
Result
Instantiates a new Result object from a DOM node- Parameters:
node
- the DOM root node representing the desired Result- Throws:
KettleException
- if any errors occur during instantiation
-
-
Method Details
-
lightClone
Performs a semi-deep copy/clone but does not clone the rows from the Result- Returns:
- An almost-clone of the Result, minus the rows
-
clone
Clones the Result, including rows and files. To perform a clone without rows, use lightClone() -
getReadWriteThroughput
Creates a string containing the read/write throughput. Throughput in this case is defined as two measures, number of lines read or written and number of lines read/written per second.- Parameters:
seconds
- the number of seconds with which to determine the read/write throughput- Returns:
- a string containing the read write throughput measures with labelling text
-
toString
Returns a string representation of the Result object -
getNrFilesRetrieved
public long getNrFilesRetrieved()Returns the number of files retrieved during execution of this transformation or job- Returns:
- the number of files retrieved
-
setNrFilesRetrieved
public void setNrFilesRetrieved(long filesRetrieved) Sets the number of files retrieved to the specified value- Parameters:
filesRetrieved
- The number of files retrieved to set.
-
getEntryNr
public long getEntryNr()Returns the entry number- Returns:
- the entry number
-
setEntryNr
public void setEntryNr(long entryNr) Sets the entry number to the specified value- Parameters:
entryNr
- The entry number to set.
-
getExitStatus
public int getExitStatus()Returns the exit status value.- Returns:
- the exit status.
-
setExitStatus
public void setExitStatus(int exitStatus) Sets the exit status value to the specified value- Parameters:
exitStatus
- The exit status to set.
-
getNrErrors
public long getNrErrors()Returns the number of errors that occurred during this transformation or job- Returns:
- the number of errors
-
setNrErrors
public void setNrErrors(long nrErrors) Sets the number of errors that occurred during execution of this transformation or job- Parameters:
nrErrors
- The number of errors to set
-
getNrLinesInput
public long getNrLinesInput()Returns the number of lines input during execution of this transformation or job- Returns:
- the number of lines input
-
setNrLinesInput
public void setNrLinesInput(long nrLinesInput) Sets the number of lines input during execution of this transformation or job- Parameters:
nrLinesInput
- The number of lines input to set.
-
getNrLinesOutput
public long getNrLinesOutput()Returns the number of lines output during execution of this transformation or job- Returns:
- the number of lines output
-
setNrLinesOutput
public void setNrLinesOutput(long nrLinesOutput) Sets the number of lines output during execution of this transformation or job- Parameters:
nrLinesOutput
- The number of lines output to set
-
getNrLinesRead
public long getNrLinesRead()Returns the number of lines read during execution of this transformation or job- Returns:
- the number of lines read
-
setNrLinesRead
public void setNrLinesRead(long nrLinesRead) Sets the number of lines read during execution of this transformation or job- Parameters:
nrLinesRead
- The number of lines read to set.
-
getNrLinesUpdated
public long getNrLinesUpdated()Returns the number of lines updated during execution of this transformation or job- Returns:
- the number of lines updated
-
setNrLinesUpdated
public void setNrLinesUpdated(long nrLinesUpdated) Sets the number of lines updated during execution of this transformation or job- Parameters:
nrLinesUpdated
- The number of lines updated to set.
-
getNrLinesWritten
public long getNrLinesWritten()Returns the number of lines written during execution of this transformation or job- Returns:
- the number of lines written
-
setNrLinesWritten
public void setNrLinesWritten(long nrLinesWritten) Sets the number of lines written during execution of this transformation or job- Parameters:
nrLinesWritten
- The number of lines written to set.
-
getNrLinesDeleted
public long getNrLinesDeleted()Returns the number of lines deleted during execution of this transformation or job- Returns:
- the number of lines deleted
-
setNrLinesDeleted
public void setNrLinesDeleted(long nrLinesDeleted) Sets the number of lines deleted during execution of this transformation or job- Parameters:
nrLinesDeleted
- The number of lines deleted to set.
-
getResult
public boolean getResult()Returns the boolean result of this transformation or job- Returns:
- true if the transformation or job was successful, false otherwise
-
setResult
public void setResult(boolean result) Sets the result of the transformation or job. A value of true should indicate a successful execution, a value of false should indicate an error condition.- Parameters:
result
- The boolean result to set.
-
getRows
Returns the resulting rowset from the job or transformation. For example, Result rows are used in jobs where entries wish to receive the results of previous executions of jobs or transformations. The Result rows can be used to do many kinds of transformation or job post-processing.- Returns:
- a List of rows associated with the result of execution of a job or transformation
-
setRows
Sets the resulting rowset from the job or transformation execution- Parameters:
rows
- The List of rows to set.
-
isStopped
public boolean isStopped()Returns whether the transformation or job was stopped before completion- Returns:
- true if stopped, false otherwise
-
setStopped
public void setStopped(boolean stopped) Sets whether the transformation or job was stopped before completion- Parameters:
stopped
- true if the transformation or job was stopped, false otherwise
-
clear
public void clear()Clears the numbers in this result, setting them all to zero. Also deletes the logging text -
add
Add the numbers of lines from a different result to this result- Parameters:
res
- The Result object from which to add
-
getXML
Returns a String object with the Result object serialized as XML- Returns:
- This Result object serialized as XML
-
getBasicXml
-
getResultFiles
Returns the result files as a Map with the filename as key and the ResultFile object as value- Returns:
- a Map with String as key and ResultFile as value.
- See Also:
-
getResultFilesList
Returns the result files as a List of type ResultFile- Returns:
- a list of type ResultFile containing this Result's ResultFile objects
- See Also:
-
setResultFiles
Sets the result files for this Result to the specified Map of ResultFile objects- Parameters:
usedFiles
- The Map of result files to set. This is a Map with the filename as key and ResultFile object as value- See Also:
-
getNrLinesRejected
public long getNrLinesRejected()Returns the number of lines rejected during execution of this transformation or job- Returns:
- the number of lines rejected
-
setNrLinesRejected
public void setNrLinesRejected(long nrLinesRejected) Sets the number of lines rejected during execution of this transformation or job- Parameters:
nrLinesRejected
- the number of lines rejected to set
-
getLogChannelId
Returns the log channel id of the object that was executed (trans, job, job entry, etc)- Returns:
- the log channel id
-
setLogChannelId
Sets the log channel id of the object that was executed (trans, job, job entry, etc)- Parameters:
logChannelId
- the logChannelId to set
-
increaseLinesRead
public void increaseLinesRead(long incr) Increases the number of lines read by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesWritten
public void increaseLinesWritten(long incr) Increases the number of lines written by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesInput
public void increaseLinesInput(long incr) Increases the number of lines input by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesOutput
public void increaseLinesOutput(long incr) Increases the number of lines output by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesUpdated
public void increaseLinesUpdated(long incr) Increases the number of lines updated by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesDeleted
public void increaseLinesDeleted(long incr) Increases the number of lines deleted by the specified value- Parameters:
incr
- the amount to increment
-
increaseLinesRejected
public void increaseLinesRejected(long incr) Increases the number of lines rejected by the specified value- Parameters:
incr
- the amount to increment
-
increaseErrors
public void increaseErrors(long incr) Increases the number of errors by the specified value- Parameters:
incr
- the amount to increment
-
getLogText
Returns all the text from any logging performed by the transformation or job- Returns:
- the logging text as a string
-
setLogText
Sets the logging text to the specified String- Parameters:
logText
- the logText to set
-
appendLogText
-
isSafeStop
public boolean isSafeStop()Sets flag for safe stopping a transformation- Returns:
- the safe stop flag
-
setSafeStop
public void setSafeStop(boolean safeStop) Returns the flag for safe stopping a transformation- Parameters:
safeStop
- the safe stop flag
-
getElapsedTimeMillis
public long getElapsedTimeMillis()Returns the elapsed time of the ETL execution in milliseconds -
setElapsedTimeMillis
public void setElapsedTimeMillis(long elapsedTimeMillis) Sets the elapsed time of the ETL execution in milliseconds- Parameters:
elapsedTimeMillis
- elapsed time of the ETL execution in milliseconds
-
getExecutionId
Returns the unique identifier of an ETL execution, should one ever care to declare one such- Returns:
- unique identifier of an ETL execution, should one ever care to declare one such
-
setExecutionId
Sets a unique identifier of an ETL execution, should one ever care to declare one such- Parameters:
executionId
- unique identifier of an ETL execution, should one ever care to declare one such
-