Package org.pentaho.di.core
Class Result
- java.lang.Object
- 
- org.pentaho.di.core.Result
 
- 
- All Implemented Interfaces:
- Cloneable
 
 public class Result extends Object implements 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 SummaryFields Modifier and Type Field Description booleanstoppedWhether the job or transformation was stopped.static StringXML_FILE_TAGA constant specifying the tag value for the XML node for the result file entrystatic StringXML_FILES_TAGA constant specifying the tag value for the XML node for result files entrystatic StringXML_ROWS_TAGA constant specifying the tag value for the XML node for the result rows entrystatic StringXML_TAGA constant specifying the tag value for the XML node of the result object
 - 
Constructor SummaryConstructors Constructor Description Result()Instantiates a new Result object, setting default values for all membersResult(int nr)Instantiates a new Result object, setting default values for all members and the entry numberResult(Node node)Instantiates a new Result object from a DOM node
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Result res)Add the numbers of lines from a different result to this resultvoidclear()Clears the numbers in this result, setting them all to zero.Resultclone()Clones the Result, including rows and files.StringgetBasicXml()longgetElapsedTimeMillis()Returns the elapsed time of the ETL execution in millisecondslonggetEntryNr()Returns the entry numberStringgetExecutionId()Returns the unique identifier of an ETL execution, should one ever care to declare one suchintgetExitStatus()Returns the exit status value.StringgetLogChannelId()Returns the log channel id of the object that was executed (trans, job, job entry, etc)StringgetLogText()Returns all the text from any logging performed by the transformation or joblonggetNrErrors()Returns the number of errors that occurred during this transformation or joblonggetNrFilesRetrieved()Returns the number of files retrieved during execution of this transformation or joblonggetNrLinesDeleted()Returns the number of lines deleted during execution of this transformation or joblonggetNrLinesInput()Returns the number of lines input during execution of this transformation or joblonggetNrLinesOutput()Returns the number of lines output during execution of this transformation or joblonggetNrLinesRead()Returns the number of lines read during execution of this transformation or joblonggetNrLinesRejected()Returns the number of lines rejected during execution of this transformation or joblonggetNrLinesUpdated()Returns the number of lines updated during execution of this transformation or joblonggetNrLinesWritten()Returns the number of lines written during execution of this transformation or jobStringgetReadWriteThroughput(int seconds)Creates a string containing the read/write throughput.booleangetResult()Returns the boolean result of this transformation or jobMap<String,ResultFile>getResultFiles()Returns the result files as a Map with the filename as key and the ResultFile object as valueList<ResultFile>getResultFilesList()Returns the result files as a List of type ResultFileList<RowMetaAndData>getRows()Returns the resulting rowset from the job or transformation.StringgetXML()Returns a String object with the Result object serialized as XMLvoidincreaseErrors(long incr)Increases the number of errors by the specified valuevoidincreaseLinesDeleted(long incr)Increases the number of lines deleted by the specified valuevoidincreaseLinesInput(long incr)Increases the number of lines input by the specified valuevoidincreaseLinesOutput(long incr)Increases the number of lines output by the specified valuevoidincreaseLinesRead(long incr)Increases the number of lines read by the specified valuevoidincreaseLinesRejected(long incr)Increases the number of lines rejected by the specified valuevoidincreaseLinesUpdated(long incr)Increases the number of lines updated by the specified valuevoidincreaseLinesWritten(long incr)Increases the number of lines written by the specified valuebooleanisSafeStop()Sets flag for safe stopping a transformationbooleanisStopped()Returns whether the transformation or job was stopped before completionResultlightClone()Performs a semi-deep copy/clone but does not clone the rows from the ResultvoidsetElapsedTimeMillis(long elapsedTimeMillis)Sets the elapsed time of the ETL execution in millisecondsvoidsetEntryNr(long entryNr)Sets the entry number to the specified valuevoidsetExecutionId(String executionId)Sets a unique identifier of an ETL execution, should one ever care to declare one suchvoidsetExitStatus(int exitStatus)Sets the exit status value to the specified valuevoidsetLogChannelId(String logChannelId)Sets the log channel id of the object that was executed (trans, job, job entry, etc)voidsetLogText(String logText)Sets the logging text to the specified StringvoidsetNrErrors(long nrErrors)Sets the number of errors that occurred during execution of this transformation or jobvoidsetNrFilesRetrieved(long filesRetrieved)Sets the number of files retrieved to the specified valuevoidsetNrLinesDeleted(long nrLinesDeleted)Sets the number of lines deleted during execution of this transformation or jobvoidsetNrLinesInput(long nrLinesInput)Sets the number of lines input during execution of this transformation or jobvoidsetNrLinesOutput(long nrLinesOutput)Sets the number of lines output during execution of this transformation or jobvoidsetNrLinesRead(long nrLinesRead)Sets the number of lines read during execution of this transformation or jobvoidsetNrLinesRejected(long nrLinesRejected)Sets the number of lines rejected during execution of this transformation or jobvoidsetNrLinesUpdated(long nrLinesUpdated)Sets the number of lines updated during execution of this transformation or jobvoidsetNrLinesWritten(long nrLinesWritten)Sets the number of lines written during execution of this transformation or jobvoidsetResult(boolean result)Sets the result of the transformation or job.voidsetResultFiles(Map<String,ResultFile> usedFiles)Sets the result files for this Result to the specified Map of ResultFile objectsvoidsetRows(List<RowMetaAndData> rows)Sets the resulting rowset from the job or transformation executionvoidsetSafeStop(boolean safeStop)Returns the flag for safe stopping a transformationvoidsetStopped(boolean stopped)Sets whether the transformation or job was stopped before completionStringtoString()Returns a string representation of the Result object
 
- 
- 
- 
Field Detail- 
XML_TAGpublic static final String XML_TAG A constant specifying the tag value for the XML node of the result object- See Also:
- Constant Field Values
 
 - 
XML_FILES_TAGpublic static final String XML_FILES_TAG A constant specifying the tag value for the XML node for result files entry- See Also:
- Constant Field Values
 
 - 
XML_FILE_TAGpublic static final String XML_FILE_TAG A constant specifying the tag value for the XML node for the result file entry- See Also:
- Constant Field Values
 
 - 
XML_ROWS_TAGpublic static final String XML_ROWS_TAG A constant specifying the tag value for the XML node for the result rows entry- See Also:
- Constant Field Values
 
 - 
stoppedpublic boolean stopped Whether the job or transformation was stopped.
 
- 
 - 
Constructor Detail- 
Resultpublic Result() Instantiates a new Result object, setting default values for all members
 - 
Resultpublic 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
 
 - 
Resultpublic Result(Node node) throws KettleException 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 Detail- 
lightClonepublic Result 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
 
 - 
clonepublic Result clone() Clones the Result, including rows and files. To perform a clone without rows, use lightClone()- Overrides:
- clonein class- Object
- Returns:
- A clone of the Result object
- See Also:
- Object.clone(),- lightClone()
 
 - 
getReadWriteThroughputpublic String getReadWriteThroughput(int seconds) 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
 
 - 
toStringpublic String toString() Returns a string representation of the Result object- Overrides:
- toStringin class- Object
- See Also:
- Object.toString()
 
 - 
getNrFilesRetrievedpublic long getNrFilesRetrieved() Returns the number of files retrieved during execution of this transformation or job- Returns:
- the number of files retrieved
 
 - 
setNrFilesRetrievedpublic void setNrFilesRetrieved(long filesRetrieved) Sets the number of files retrieved to the specified value- Parameters:
- filesRetrieved- The number of files retrieved to set.
 
 - 
getEntryNrpublic long getEntryNr() Returns the entry number- Returns:
- the entry number
 
 - 
setEntryNrpublic void setEntryNr(long entryNr) Sets the entry number to the specified value- Parameters:
- entryNr- The entry number to set.
 
 - 
getExitStatuspublic int getExitStatus() Returns the exit status value.- Returns:
- the exit status.
 
 - 
setExitStatuspublic void setExitStatus(int exitStatus) Sets the exit status value to the specified value- Parameters:
- exitStatus- The exit status to set.
 
 - 
getNrErrorspublic long getNrErrors() Returns the number of errors that occurred during this transformation or job- Returns:
- the number of errors
 
 - 
setNrErrorspublic 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
 
 - 
getNrLinesInputpublic long getNrLinesInput() Returns the number of lines input during execution of this transformation or job- Returns:
- the number of lines input
 
 - 
setNrLinesInputpublic 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.
 
 - 
getNrLinesOutputpublic long getNrLinesOutput() Returns the number of lines output during execution of this transformation or job- Returns:
- the number of lines output
 
 - 
setNrLinesOutputpublic 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
 
 - 
getNrLinesReadpublic long getNrLinesRead() Returns the number of lines read during execution of this transformation or job- Returns:
- the number of lines read
 
 - 
setNrLinesReadpublic 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.
 
 - 
getNrLinesUpdatedpublic long getNrLinesUpdated() Returns the number of lines updated during execution of this transformation or job- Returns:
- the number of lines updated
 
 - 
setNrLinesUpdatedpublic 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.
 
 - 
getNrLinesWrittenpublic long getNrLinesWritten() Returns the number of lines written during execution of this transformation or job- Returns:
- the number of lines written
 
 - 
setNrLinesWrittenpublic 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.
 
 - 
getNrLinesDeletedpublic long getNrLinesDeleted() Returns the number of lines deleted during execution of this transformation or job- Returns:
- the number of lines deleted
 
 - 
setNrLinesDeletedpublic 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.
 
 - 
getResultpublic boolean getResult() Returns the boolean result of this transformation or job- Returns:
- true if the transformation or job was successful, false otherwise
 
 - 
setResultpublic 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.
 
 - 
getRowspublic List<RowMetaAndData> 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
 
 - 
setRowspublic void setRows(List<RowMetaAndData> rows) Sets the resulting rowset from the job or transformation execution- Parameters:
- rows- The List of rows to set.
 
 - 
isStoppedpublic boolean isStopped() Returns whether the transformation or job was stopped before completion- Returns:
- true if stopped, false otherwise
 
 - 
setStoppedpublic 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
 
 - 
clearpublic void clear() Clears the numbers in this result, setting them all to zero. Also deletes the logging text
 - 
addpublic void add(Result res) Add the numbers of lines from a different result to this result- Parameters:
- res- The Result object from which to add
 
 - 
getXMLpublic String getXML() Returns a String object with the Result object serialized as XML- Returns:
- This Result object serialized as XML
 
 - 
getBasicXmlpublic String getBasicXml() 
 - 
getResultFilespublic Map<String,ResultFile> 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:
- ResultFile
 
 - 
getResultFilesListpublic List<ResultFile> 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:
- ResultFile
 
 - 
setResultFilespublic void setResultFiles(Map<String,ResultFile> usedFiles) 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:
- ResultFile
 
 - 
getNrLinesRejectedpublic long getNrLinesRejected() Returns the number of lines rejected during execution of this transformation or job- Returns:
- the number of lines rejected
 
 - 
setNrLinesRejectedpublic 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
 
 - 
getLogChannelIdpublic String getLogChannelId() Returns the log channel id of the object that was executed (trans, job, job entry, etc)- Returns:
- the log channel id
 
 - 
setLogChannelIdpublic void setLogChannelId(String logChannelId) Sets the log channel id of the object that was executed (trans, job, job entry, etc)- Parameters:
- logChannelId- the logChannelId to set
 
 - 
increaseLinesReadpublic void increaseLinesRead(long incr) Increases the number of lines read by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesWrittenpublic void increaseLinesWritten(long incr) Increases the number of lines written by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesInputpublic void increaseLinesInput(long incr) Increases the number of lines input by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesOutputpublic void increaseLinesOutput(long incr) Increases the number of lines output by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesUpdatedpublic void increaseLinesUpdated(long incr) Increases the number of lines updated by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesDeletedpublic void increaseLinesDeleted(long incr) Increases the number of lines deleted by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseLinesRejectedpublic void increaseLinesRejected(long incr) Increases the number of lines rejected by the specified value- Parameters:
- incr- the amount to increment
 
 - 
increaseErrorspublic void increaseErrors(long incr) Increases the number of errors by the specified value- Parameters:
- incr- the amount to increment
 
 - 
getLogTextpublic String getLogText() Returns all the text from any logging performed by the transformation or job- Returns:
- the logging text as a string
 
 - 
setLogTextpublic void setLogText(String logText) Sets the logging text to the specified String- Parameters:
- logText- the logText to set
 
 - 
isSafeStoppublic boolean isSafeStop() Sets flag for safe stopping a transformation- Returns:
- the safe stop flag
 
 - 
setSafeStoppublic void setSafeStop(boolean safeStop) Returns the flag for safe stopping a transformation- Parameters:
- safeStop- the safe stop flag
 
 - 
getElapsedTimeMillispublic long getElapsedTimeMillis() Returns the elapsed time of the ETL execution in milliseconds
 - 
setElapsedTimeMillispublic void setElapsedTimeMillis(long elapsedTimeMillis) Sets the elapsed time of the ETL execution in milliseconds- Parameters:
- elapsedTimeMillis- elapsed time of the ETL execution in milliseconds
 
 - 
getExecutionIdpublic String 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
 
 - 
setExecutionIdpublic void setExecutionId(String executionId) 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
 
 
- 
 
-