Package org.pentaho.di.trans
Class Trans
java.lang.Object
org.pentaho.di.trans.Trans
- All Implemented Interfaces:
ExecutorInterface
,org.pentaho.di.core.ExtensionDataInterface
,HasLogChannelInterface
,org.pentaho.di.core.logging.LoggingObjectInterface
,org.pentaho.di.core.logging.LoggingObjectLifecycleInterface
,org.pentaho.di.core.parameters.NamedParams
,org.pentaho.di.core.variables.VariableSpace
public class Trans
extends Object
implements org.pentaho.di.core.variables.VariableSpace, org.pentaho.di.core.parameters.NamedParams, HasLogChannelInterface, org.pentaho.di.core.logging.LoggingObjectInterface, ExecutorInterface, org.pentaho.di.core.ExtensionDataInterface
This class represents the information and operations associated with the concept of a Transformation. It loads,
instantiates, initializes, runs, and monitors the execution of the transformation contained in the specified
TransInfo object.
- Since:
- 07-04-2003
- Author:
- Matt
-
Field Summary
Modifier and TypeFieldDescriptionprotected String[]
The command line arguments for the transformation.int
The class number.static final String
Constant specifying a filename containing XML to inject into a ZIP file created during resource export.protected String
The container object id.A table of named counters.protected org.pentaho.di.core.logging.LogChannelInterface
The log channel interface.protected int
The log commit size.protected org.pentaho.di.core.logging.LogLevel
The log level.protected org.pentaho.metastore.api.IMetaStore
The MetaStore to usestatic final String
The replay date format.protected Repository
The repository we are referencing.protected List<org.pentaho.di.core.ResultFile>
protected List<org.pentaho.di.core.RowMetaAndData>
List<org.pentaho.di.core.RowSet>
A list of all the row sets.static final String
Constant indicating a transformation status of Finished.static final String
Constant indicating a transformation status of Finished (with errors).static final String
Constant indicating a transformation status of Halting.static final String
Constant indicating a transformation status of Initializing.static final String
Constant indicating a transformation status of Paused.static final String
Constant indicating a transformation status of Preparing for execution.static final String
Constant indicating a transformation status of Running.static final String
Constant indicating a transformation status of Stopped.static final String
Constant indicating a transformation status of Stopped (with errors).static final String
Constant indicating a transformation status of Waiting.protected TransMeta
The transformation metadata to execute.static final int
Constant indicating a dispatch type of 1-to-1.static final int
Constant indicating a dispatch type of 1-to-N.static final int
Constant indicating a dispatch type of N-to-1.static final int
Constant indicating a dispatch type of N-to-M.static final int
Constant indicating a dispatch type of N-to-N. -
Constructor Summary
ConstructorDescriptionTrans()
Instantiates a new transformation.Initializes a transformation from transformation meta-data defined in memory.Initializes a transformation from transformation meta-data defined in memory.Trans
(Parent parent, Repository rep, String name, String dirname, String filename) Instantiates a new transformation using any of the provided parameters including the variable bindings, a repository, a name, a repository directory name, and a filename.Trans
(Parent parent, Repository rep, String name, String dirname, String filename, TransMeta parentTransMeta) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates all parameters by setting their values.void
addActiveSubTransformation
(String subTransName, Trans subTrans) void
addDelegationListener
(DelegationListener delegationListener) void
addParameterDefinition
(String key, String defValue, String description) Adds a parameter definition to this transformation.addRowProducer
(String stepname, int copynr) This adds a row producer to the transformation that just got set up.protected void
Adds a step performance snapshot.void
addTransListener
(TransListener transListener) Adds a transformation listener.void
addTransStoppedListener
(TransStoppedListener transStoppedListener) Adds a stop-event listener to the transformation.void
Begin processing.void
Calculate the batch id and date range for the transformation.Calculates the transaction ID for the transformation.void
void
void
cleanup()
This method performs any cleanup operations, typically called after the transformation has finished.static int
cleanupCluster
(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter) Cleanup the cluster, including the master and all slaves, and return the number of errors that occurred.static void
cleanupSlaveServer
(TransSplitter transSplitter, SlaveServer slaveServer, TransMeta slaveTransMeta) Cleanup the slave server as part of a clustered transformation.void
Clear the error in the transformation, clear all the rows from all the row sets, to make sure the transformation can continue with other data.void
Clear the values of all parameters.void
copyParametersFrom
(org.pentaho.di.core.parameters.NamedParams params) Copy parameters from a NamedParams object.void
copyVariablesFrom
(org.pentaho.di.core.variables.VariableSpace space) Copies variables from a given variable space to this transformation.protected org.pentaho.di.core.database.Database
createDataBase
(org.pentaho.di.core.database.DatabaseMeta meta) void
environmentSubstitute
(String aString) Substitutes any variable values into the given string, and returns the resolved string.String[]
environmentSubstitute
(String[] aString) Substitutes any variable values into each of the given strings, and returns an array containing the resolved string(s).void
Remove all parameters.void
Executes the transformation.static void
executeClustered
(TransSplitter transSplitter, TransExecutionConfiguration executionConfiguration) Executes an existing TransSplitter, with the transformation already split.static TransSplitter
executeClustered
(TransMeta transMeta, TransExecutionConfiguration executionConfiguration) Execute the transformation in a clustered fashion.fieldSubstitute
(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData) findBaseSteps
(String stepname) Find the base steps for the step with the specified name.findDataInterface
(String name) Find the data interface for the step with the specified name.Gets the mapping inputs for each step in the transformation.Gets the mapping outputs for each step in the transformation.org.pentaho.di.core.RowSet
findRowSet
(String rowsetname) Finds the RowSet with the specified name.org.pentaho.di.core.RowSet
findRowSet
(String from, int fromcopy, String to, int tocopy) Finds the RowSet between two steps (or copies of steps).findRunThread
(String stepname) Find the run thread for the step with the specified name.findStepInterface
(String stepname, int copyNr) Find the executing step copy for the step with the specified name and copy numberfindStepInterfaces
(String stepname) Find the available executing step copies for the step with the specified nameprotected void
Make attempt to fire all registered listeners if possible.protected void
Fires the start-event listeners (if any are registered).Gets the active sub-jobs.getActiveSubTransformation
(String subTransName) Deprecated.String[]
long
Gets the batch ID of the transformation.boolean
getBooleanValueOfVariable
(String variableName, boolean defaultValue) Returns a boolean representation of the specified variable after performing any necessary substitution.static final org.pentaho.di.core.Result
getClusteredTransformationResult
(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob) Gets the clustered transformation result.static final org.pentaho.di.core.Result
getClusteredTransformationResult
(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob, boolean loggingRemoteWork) Gets the clustered transformation result.Gets the container object ID.Gets the current date/time object.Gets the dependency date for the transformation.Gets the end date/time object for the transformation.int
getEnded()
Gets the number of steps in the transformation that are in an end state, such as Finished, Halted, or Stopped.int
Gets the number of errors that have occurred during execution of the transformation.Gets the name of the executing server.Gets the name of the executing user.Gets the filename of the transformation, or null if no filename existsGets the job end date.Gets the job start date.long
Gets a representable metric of the "processed" lines of the last step.int
Gets the logBufferStartLine.org.pentaho.di.core.logging.LogChannelInterface
Gets the log channel interface for the transformation.Gets the log channel ID.Gets the date the transformation was logged.List<org.pentaho.di.core.logging.LoggingHierarchy>
Gets the logging hierarchy.org.pentaho.di.core.logging.LogLevel
Gets the log level.Gets the mapping step name.org.pentaho.metastore.api.IMetaStore
getName()
Gets the name of the transformation.Gets the object copy.org.pentaho.di.repository.ObjectId
Gets the object ID.Gets the object name.org.pentaho.di.repository.ObjectRevision
Gets the object revision.org.pentaho.di.core.logging.LoggingObjectType
Gets the object type.Gets the default value of the specified parameter.Gets the description of the specified parameter.getParameterValue
(String key) Gets the value of the specified parameter.org.pentaho.di.core.logging.LoggingObjectInterface
Gets the parent logging object interface.Gets the parent job, or null if there is no parent.Gets the parent transformation, which is null if no parent transformation exists.org.pentaho.di.core.variables.VariableSpace
Gets the parent variable space.long
Get the batch ID that is passed from the parent job to the transformation.org.pentaho.di.core.Result
Gets the registration date.Gets the replay date.Gets the repository object for the transformation.org.pentaho.di.repository.RepositoryDirectoryInterface
Gets the repository directory.org.pentaho.di.core.Result
Gets the result of the transformation.List<org.pentaho.di.core.ResultFile>
List<org.pentaho.di.core.RowMetaAndData>
List<org.pentaho.di.core.RowSet>
Gets the rowsets for the transformation.getRunThread
(int i) Gets the run thread for the step at the specified index.getRunThread
(String name, int copy) Gets the run thread for the step with the specified name and copy number.Gets the servlet print writer.javax.servlet.http.HttpServletRequest
javax.servlet.http.HttpServletResponse
Gets the socket repository.Gets the start date/time object for the transformation.Gets the status of the transformation (Halting, Finished, Paused, etc.)getStepDataInterface
(String stepname, int stepcopy) Finds the StepDataInterface (currently) associated with the specified step.getStepInterface
(String stepname, int copy) Find the StepInterface (thread) by looking it up using the name.Gets a named list (map) of step performance snapshots.getSteps()
Gets a list of steps in the transformation.Deprecated.Gets the transaction ID for the transformation.Gets a list of the transformation listeners.Gets the meta-data for the transformation.Checks the execution status of each step in the transformations.boolean[]
Checks whether the transformation steps are running lookup.Gets the list of stop-event listeners for the transformation.getVariable
(String variableName) Gets the value of the specified variable, or returns a default value if no such variable exists.getVariable
(String variableName, String defaultValue) Gets the value of the specified variable, or returns a default value if no such variable exists.boolean
Checks whether the transformation has any steps that are halted.boolean
hasStepStarted
(String sname, int copy) Checks whether the specified step (or step copy) has started.void
initializeVariablesFrom
(org.pentaho.di.core.variables.VariableSpace parent) Sets the values of the transformation's variables to the values from the parent variables.void
injectVariables
(Map<String, String> prop) Injects variables using the given Map.boolean
boolean
Checks if the transformation is finished\.boolean
boolean
boolean
boolean
Checks whether the transformation is initializing.boolean
Checks whether the running transformation is being monitored.boolean
isPaused()
Checks if the transformation is paused.boolean
Checks whether the transformation is preparing for execution.boolean
Checks whether the transformation is being previewed.boolean
Checks whether the transformation is ready to start (i.e.boolean
boolean
Checks whether the transformation is running.boolean
Checks whether safe mode is enabled.boolean
Checks if the transformation is stopped.void
killAll()
Deprecated.Deprecated as of 8.0.String[]
Gets a list of the parameters for the transformation.String[]
Gets a list of variable names for the transformation.void
Logs a summary message for the specified step.void
mergeParametersWith
(org.pentaho.di.core.parameters.NamedParams params, boolean replace) static final long
monitorClusteredTransformation
(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob) Monitors a clustered transformation every second, after all the transformations in a cluster schema are running.static final long
monitorClusteredTransformation
(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob, int sleepTimeSeconds) Monitors a clustered transformation every second, after all the transformations in a cluster schema are running.static void
monitorRemoteTransformation
(org.pentaho.di.core.logging.LogChannelInterface log, String carteObjectId, String transName, SlaveServer remoteSlaveServer) Monitors a remote transformation every 5 seconds.static void
monitorRemoteTransformation
(org.pentaho.di.core.logging.LogChannelInterface log, String carteObjectId, String transName, SlaveServer remoteSlaveServer, int sleepTimeSeconds) Monitors a remote transformation at the specified interval.void
int
Gets the number of active (i.e.int
nrSteps()
Gets the number of steps in this transformation.void
Pauses the transformation (pause all steps).void
prepareExecution
(String[] arguments) Prepares the transformation for execution.void
printStats
(int seconds) Logs the execution statistics for the transformation for the specified time interval.removeActiveSubTransformation
(String subTransName) void
Resumes running the transformation after a pause (resume all steps).void
safeStop()
Stops only input steps so that all downstream steps can finish processing rows that have already been inputstatic String
sendToSlaveServer
(TransMeta transMeta, TransExecutionConfiguration executionConfiguration, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) Send the transformation for execution to a Carte slave server.void
setArguments
(String[] arguments) void
setBatchId
(long batchId) Sets the batch ID of the transformation.void
setContainerObjectId
(String containerObjectId) Sets the container object ID.void
setCounters
(Hashtable<String, org.pentaho.di.core.Counter> counters) void
setDelegationListeners
(List<DelegationListener> delegationListeners) void
setExecutingClustered
(boolean executingClustered) void
setExecutingServer
(String executingServer) Sets the name of the executing server.void
setExecutingUser
(String executingUser) Sets the name of the executing user.protected void
setFinished
(boolean finished) void
setForcingSeparateLogging
(boolean forcingSeparateLogging) void
setGatheringMetrics
(boolean gatheringMetrics) void
setInitializing
(boolean initializing) Sets whether the transformation is initializing.void
Sets logBufferStartLine based on LoggingBuffer last line numberprotected void
setInternalEntryCurrentDirectory
(boolean hasFilename, boolean hasRepoDir) void
setInternalKettleVariables
(org.pentaho.di.core.variables.VariableSpace var) Sets the internal kettle variables.void
setJobEndDate
(Date jobEndDate) Sets the job end date.void
setJobStartDate
(Date jobStartDate) Sets the job start date.void
setLog
(org.pentaho.di.core.logging.LogChannelInterface log) Sets the log channel interface for the transformation.void
setLogBufferStartLine
(int lineNr) Sets the logBufferStartLine.void
setLogLevel
(org.pentaho.di.core.logging.LogLevel logLevel) Sets the log level.void
setMappingStepName
(String mappingStepName) Sets the mapping step name.void
setMetaStore
(org.pentaho.metastore.api.IMetaStore metaStore) void
setMonitored
(boolean monitored) Sets whether the running transformation should be monitored.void
setParameterValue
(String key, String value) Sets the value for the specified parameter.void
setParent
(org.pentaho.di.core.logging.LoggingObjectInterface parent) Sets the parent logging object.void
setParentJob
(Job parentJob) Sets the parent job for the transformation.void
setParentTrans
(Trans parentTrans) Sets the parent transformation.void
setParentVariableSpace
(org.pentaho.di.core.variables.VariableSpace parent) Sets the parent variable space.void
setPassedBatchId
(long jobBatchId) Sets the passed batch ID of the transformation from the batch ID of the parent job.void
setPaused
(boolean paused) void
setPreparing
(boolean preparing) Sets whether the transformation is preparing for execution.void
setPreview
(boolean preview) Sets whether the transformation is being previewed.void
setPreviousResult
(org.pentaho.di.core.Result previousResult) protected void
setReadyToStart
(boolean ready) void
setReplayDate
(Date replayDate) Sets the replay date.void
setRepository
(Repository repository) Sets the repository object for the transformation.void
setResultFiles
(List<org.pentaho.di.core.ResultFile> resultFiles) void
setResultRows
(List<org.pentaho.di.core.RowMetaAndData> resultRows) void
setResultRowSet
(boolean resultRowsSet) void
setRunning
(boolean running) Sets whether the transformation is running.void
setSafeModeEnabled
(boolean safeModeEnabled) Turn on safe mode during running: the transformation will run slower but with more checking enabled.void
setServletPrintWriter
(PrintWriter servletPrintWriter) Sets the servlet print writer.void
setServletReponse
(javax.servlet.http.HttpServletResponse response) Sets encoding of HttpServletResponse according to System encoding.Check if system encoding is null or an empty and set it to HttpServletResponse when not and writes error to log if null.void
setServletRequest
(javax.servlet.http.HttpServletRequest request) void
setSocketRepository
(SocketRepository socketRepository) Sets the socket repository.void
setStepPerformanceSnapShots
(Map<String, List<StepPerformanceSnapShot>> stepPerformanceSnapShots) Sets the named list (map) of step performance snapshots.protected void
setSteps
(List<StepMetaDataCombi> steps) void
setStopped
(boolean stopped) void
setThreadName
(String threadName) Deprecated.void
setTransactionId
(String transactionId) Sets the transaction ID for the transformation.void
setTransListeners
(List<TransListener> transListeners) Sets the list of transformation listeners.void
setTransMeta
(TransMeta transMeta) Sets the meta-data for the transformation.void
setTransStoppedListeners
(List<TransStoppedListener> transStoppedListeners) Sets the list of stop-event listeners for the transformation.void
setVariable
(String variableName, String variableValue) Sets the value of the specified variable to the specified value.void
shareVariablesWith
(org.pentaho.di.core.variables.VariableSpace space) Shares a variable space from another variable space.protected void
shutdownHeartbeat
(ExecutorService heartbeat) protected ExecutorService
startHeartbeat
(long intervalInSeconds) void
Starts the threads prepared by prepareThreads().void
stopAll()
Stops all steps from running, and alerts any registered listeners.void
stopStep
(StepMetaDataCombi combi, boolean safeStop) toString()
Gets a string representation of the transformation.void
Waits until all RunThreads have finished.protected void
Writes log channel information to a channel logging table (if one has been configured).protected void
protected void
Writes step information to a step logging table (if one has been configured).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.pentaho.di.core.variables.VariableSpace
environmentSubstitute
-
Field Details
-
REPLAY_DATE_FORMAT
The replay date format.- See Also:
-
log
protected org.pentaho.di.core.logging.LogChannelInterface logThe log channel interface. -
logLevel
protected org.pentaho.di.core.logging.LogLevel logLevelThe log level. -
containerObjectId
The container object id. -
logCommitSize
protected int logCommitSizeThe log commit size. -
transMeta
The transformation metadata to execute. -
repository
The repository we are referencing. -
metaStore
protected org.pentaho.metastore.api.IMetaStore metaStoreThe MetaStore to use -
rowsets
A list of all the row sets. -
class_nr
public int class_nrThe class number. -
TYPE_DISP_1_1
public static final int TYPE_DISP_1_1Constant indicating a dispatch type of 1-to-1.- See Also:
-
TYPE_DISP_1_N
public static final int TYPE_DISP_1_NConstant indicating a dispatch type of 1-to-N.- See Also:
-
TYPE_DISP_N_1
public static final int TYPE_DISP_N_1Constant indicating a dispatch type of N-to-1.- See Also:
-
TYPE_DISP_N_N
public static final int TYPE_DISP_N_NConstant indicating a dispatch type of N-to-N.- See Also:
-
TYPE_DISP_N_M
public static final int TYPE_DISP_N_MConstant indicating a dispatch type of N-to-M.- See Also:
-
STRING_FINISHED
Constant indicating a transformation status of Finished.- See Also:
-
STRING_FINISHED_WITH_ERRORS
Constant indicating a transformation status of Finished (with errors).- See Also:
-
STRING_RUNNING
Constant indicating a transformation status of Running.- See Also:
-
STRING_PAUSED
Constant indicating a transformation status of Paused.- See Also:
-
STRING_PREPARING
Constant indicating a transformation status of Preparing for execution.- See Also:
-
STRING_INITIALIZING
Constant indicating a transformation status of Initializing.- See Also:
-
STRING_WAITING
Constant indicating a transformation status of Waiting.- See Also:
-
STRING_STOPPED
Constant indicating a transformation status of Stopped.- See Also:
-
STRING_STOPPED_WITH_ERRORS
Constant indicating a transformation status of Stopped (with errors).- See Also:
-
STRING_HALTING
Constant indicating a transformation status of Halting.- See Also:
-
CONFIGURATION_IN_EXPORT_FILENAME
Constant specifying a filename containing XML to inject into a ZIP file created during resource export.- See Also:
-
resultRows
-
resultFiles
-
arguments
The command line arguments for the transformation. -
counters
A table of named counters.
-
-
Constructor Details
-
Trans
public Trans()Instantiates a new transformation. -
Trans
Initializes a transformation from transformation meta-data defined in memory.- Parameters:
transMeta
- the transformation meta-data to use.
-
Trans
Initializes a transformation from transformation meta-data defined in memory. Also take into account the parent log channel interface (job or transformation) for logging lineage purposes.- Parameters:
transMeta
- the transformation meta-data to use.parent
- the parent job that is executing this transformation
-
Trans
public Trans(Parent parent, Repository rep, String name, String dirname, String filename) throws org.pentaho.di.core.exception.KettleException Instantiates a new transformation using any of the provided parameters including the variable bindings, a repository, a name, a repository directory name, and a filename. This is a multi-purpose method that supports loading a transformation from a file (if the filename is provided but not a repository object) or from a repository (if the repository object, repository directory name, and transformation name are specified).- Parameters:
parent
- the parent variable space and named paramsrep
- the repositoryname
- the name of the transformationdirname
- the dirname the repository directory namefilename
- the filename containing the transformation definition- Throws:
org.pentaho.di.core.exception.KettleException
- if any error occurs during loading, parsing, or creation of the transformation
-
Trans
public Trans(Parent parent, Repository rep, String name, String dirname, String filename, TransMeta parentTransMeta) throws org.pentaho.di.core.exception.KettleException - Throws:
org.pentaho.di.core.exception.KettleException
-
-
Method Details
-
setParent
public void setParent(org.pentaho.di.core.logging.LoggingObjectInterface parent) Sets the parent logging object.- Parameters:
parent
- the new parent
-
getLogChannel
public org.pentaho.di.core.logging.LogChannelInterface getLogChannel()Gets the log channel interface for the transformation.- Specified by:
getLogChannel
in interfaceHasLogChannelInterface
- Returns:
- the log channel
- See Also:
-
setLog
public void setLog(org.pentaho.di.core.logging.LogChannelInterface log) Sets the log channel interface for the transformation.- Parameters:
log
- the new log channel interface
-
getName
Gets the name of the transformation.- Returns:
- the transformation name
-
execute
Executes the transformation. This method will prepare the transformation for execution and then start all the threads associated with the transformation and its steps.- Parameters:
arguments
- the arguments- Throws:
org.pentaho.di.core.exception.KettleException
- if the transformation could not be prepared (initialized)
-
prepareExecution
public void prepareExecution(String[] arguments) throws org.pentaho.di.core.exception.KettleException Prepares the transformation for execution. This includes setting the arguments and parameters as well as preparing and tracking the steps and hops in the transformation.- Parameters:
arguments
- the arguments to use for this transformation- Throws:
org.pentaho.di.core.exception.KettleException
- in case the transformation could not be prepared (initialized)
-
startThreads
public void startThreads() throws org.pentaho.di.core.exception.KettleExceptionStarts the threads prepared by prepareThreads(). Before you start the threads, you can add RowListeners to them.- Throws:
org.pentaho.di.core.exception.KettleException
- if there is a communication error with a remote output socket.
-
fireTransFinishedListeners
protected void fireTransFinishedListeners() throws org.pentaho.di.core.exception.KettleExceptionMake attempt to fire all registered listeners if possible.- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during notification
-
fireTransStartedListeners
protected void fireTransStartedListeners() throws org.pentaho.di.core.exception.KettleExceptionFires the start-event listeners (if any are registered).- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during notification
-
addStepPerformanceSnapShot
protected void addStepPerformanceSnapShot()Adds a step performance snapshot. -
cleanup
public void cleanup()This method performs any cleanup operations, typically called after the transformation has finished. Specifically, after ALL the slave transformations in a clustered run have finished. -
logSummary
Logs a summary message for the specified step.- Parameters:
si
- the step interface
-
waitUntilFinished
public void waitUntilFinished()Waits until all RunThreads have finished. -
getErrors
public int getErrors()Gets the number of errors that have occurred during execution of the transformation.- Returns:
- the number of errors
-
getEnded
public int getEnded()Gets the number of steps in the transformation that are in an end state, such as Finished, Halted, or Stopped.- Returns:
- the number of ended steps
-
isFinished
public boolean isFinished()Checks if the transformation is finished\.- Returns:
- true if the transformation is finished, false otherwise
-
setFinished
protected void setFinished(boolean finished) -
isFinishedOrStopped
public boolean isFinishedOrStopped() -
killAll
Deprecated.Deprecated as of 8.0. Seems unused; will be to remove in 8.1 (ccaspanello)Attempts to stops all running steps and subtransformations. If all steps have finished, the transformation is marked as Finished. -
printStats
public void printStats(int seconds) Logs the execution statistics for the transformation for the specified time interval. If the total length of execution is supplied as the interval, then the statistics represent the average throughput (lines read/written/updated/rejected/etc. per second) for the entire execution.- Parameters:
seconds
- the time interval (in seconds)
-
getLastProcessed
public long getLastProcessed()Gets a representable metric of the "processed" lines of the last step.- Returns:
- the number of lines processed by the last step
-
findRowSet
Finds the RowSet with the specified name.- Parameters:
rowsetname
- the rowsetname- Returns:
- the row set, or null if none found
-
findRowSet
Finds the RowSet between two steps (or copies of steps).- Parameters:
from
- the name of the "from" stepfromcopy
- the copy number of the "from" stepto
- the name of the "to" steptocopy
- the copy number of the "to" step- Returns:
- the row set, or null if none found
-
hasStepStarted
Checks whether the specified step (or step copy) has started.- Parameters:
sname
- the step namecopy
- the copy number- Returns:
- true the specified step (or step copy) has started, false otherwise
-
safeStop
public void safeStop()Stops only input steps so that all downstream steps can finish processing rows that have already been input -
stopAll
public void stopAll()Stops all steps from running, and alerts any registered listeners. -
stopStep
-
notifyStoppedListeners
public void notifyStoppedListeners() -
nrSteps
public int nrSteps()Gets the number of steps in this transformation.- Returns:
- the number of steps
-
nrActiveSteps
public int nrActiveSteps()Gets the number of active (i.e. not finished) steps in this transformation- Returns:
- the number of active steps
-
getTransStepIsRunningLookup
public boolean[] getTransStepIsRunningLookup()Checks whether the transformation steps are running lookup.- Returns:
- a boolean array associated with the step list, indicating whether that step is running a lookup.
-
getTransStepExecutionStatusLookup
Checks the execution status of each step in the transformations.- Returns:
- an array associated with the step list, indicating the status of that step.
-
getRunThread
Gets the run thread for the step at the specified index.- Parameters:
i
- the index of the desired step- Returns:
- a StepInterface object corresponding to the run thread for the specified step
-
getRunThread
Gets the run thread for the step with the specified name and copy number.- Parameters:
name
- the step namecopy
- the copy number- Returns:
- a StepInterface object corresponding to the run thread for the specified step
-
calculateBatchIdAndDateRange
public void calculateBatchIdAndDateRange() throws org.pentaho.di.core.exception.KettleTransExceptionCalculate the batch id and date range for the transformation.- Throws:
org.pentaho.di.core.exception.KettleTransException
- if there are any errors during calculation
-
beginProcessing
public void beginProcessing() throws org.pentaho.di.core.exception.KettleTransExceptionBegin processing. Also handle logging operations related to the start of the transformation- Throws:
org.pentaho.di.core.exception.KettleTransException
- the kettle trans exception
-
writeLogChannelInformation
protected void writeLogChannelInformation() throws org.pentaho.di.core.exception.KettleExceptionWrites log channel information to a channel logging table (if one has been configured).- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during logging
-
writeStepLogInformation
protected void writeStepLogInformation() throws org.pentaho.di.core.exception.KettleExceptionWrites step information to a step logging table (if one has been configured).- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during logging
-
createDataBase
protected org.pentaho.di.core.database.Database createDataBase(org.pentaho.di.core.database.DatabaseMeta meta) -
writeMetricsInformation
protected void writeMetricsInformation() throws org.pentaho.di.core.exception.KettleException- Throws:
org.pentaho.di.core.exception.KettleException
-
getResult
public org.pentaho.di.core.Result getResult()Gets the result of the transformation. The Result object contains such measures as the number of errors, number of lines read/written/input/output/updated/rejected, etc.- Returns:
- the Result object containing resulting measures from execution of the transformation
-
findRunThread
Find the run thread for the step with the specified name.- Parameters:
stepname
- the step name- Returns:
- a StepInterface object corresponding to the run thread for the specified step
-
findBaseSteps
Find the base steps for the step with the specified name.- Parameters:
stepname
- the step name- Returns:
- the list of base steps for the specified step
-
findStepInterface
Find the executing step copy for the step with the specified name and copy number- Parameters:
stepname
- the step namecopyNr
-- Returns:
- the executing step found or null if no copy could be found.
-
findStepInterfaces
Find the available executing step copies for the step with the specified name- Parameters:
stepname
- the step name- Returns:
- the list of executing step copies found or null if no steps are available yet (incorrect usage)
-
findDataInterface
Find the data interface for the step with the specified name.- Parameters:
name
- the step name- Returns:
- the step data interface
-
getStartDate
Gets the start date/time object for the transformation.- Returns:
- Returns the startDate.
-
getEndDate
Gets the end date/time object for the transformation.- Returns:
- Returns the endDate.
-
isMonitored
public boolean isMonitored()Checks whether the running transformation is being monitored.- Returns:
- true the running transformation is being monitored, false otherwise
-
setMonitored
public void setMonitored(boolean monitored) Sets whether the running transformation should be monitored.- Parameters:
monitored
- true if the running transformation should be monitored, false otherwise
-
getTransMeta
Gets the meta-data for the transformation.- Returns:
- Returns the transformation meta-data
-
setTransMeta
Sets the meta-data for the transformation.- Parameters:
transMeta
- The transformation meta-data to set.
-
getCurrentDate
Gets the current date/time object.- Returns:
- the current date
-
getDepDate
Gets the dependency date for the transformation. A transformation can have a list of dependency fields. If any of these fields have a maximum date higher than the dependency date of the last run, the date range is set to to (-oo, now). The use-case is the incremental population of Slowly Changing Dimensions (SCD).- Returns:
- Returns the dependency date
-
getLogDate
Gets the date the transformation was logged.- Returns:
- the log date
-
getRowsets
Gets the rowsets for the transformation.- Returns:
- a list of rowsets
-
getSteps
Gets a list of steps in the transformation.- Returns:
- a list of the steps in the transformation
-
setSteps
-
toString
Gets a string representation of the transformation. -
findMappingInput
Gets the mapping inputs for each step in the transformation.- Returns:
- an array of MappingInputs
-
findMappingOutput
Gets the mapping outputs for each step in the transformation.- Returns:
- an array of MappingOutputs
-
getStepInterface
Find the StepInterface (thread) by looking it up using the name.- Parameters:
stepname
- The name of the step to look forcopy
- the copy number of the step to look for- Returns:
- the StepInterface or null if nothing was found.
-
getReplayDate
Gets the replay date. The replay date is used to indicate that the transformation was replayed (re-tried, run again) with that particular replay date. You can use this in Text File/Excel Input to allow you to save error line numbers into a file (SOURCE_FILE.line for example) During replay, only the lines that have errors in them are passed to the next steps, the other lines are ignored. This is for the use case: if the document contained errors (bad dates, chars in numbers, etc), you simply send the document back to the source (the user/departement that created it probably) and when you get it back, re-run the last transformation.- Returns:
- the replay date
-
setReplayDate
Sets the replay date. The replay date is used to indicate that the transformation was replayed (re-tried, run again) with that particular replay date. You can use this in Text File/Excel Input to allow you to save error line numbers into a file (SOURCE_FILE.line for example) During replay, only the lines that have errors in them are passed to the next steps, the other lines are ignored. This is for the use case: if the document contained errors (bad dates, chars in numbers, etc), you simply send the document back to the source (the user/departement that created it probably) and when you get it back, re-run the last transformation.- Parameters:
replayDate
- the new replay date
-
setSafeModeEnabled
public void setSafeModeEnabled(boolean safeModeEnabled) Turn on safe mode during running: the transformation will run slower but with more checking enabled.- Parameters:
safeModeEnabled
- true for safe mode
-
isSafeModeEnabled
public boolean isSafeModeEnabled()Checks whether safe mode is enabled.- Returns:
- Returns true if the safe mode is enabled: the transformation will run slower but with more checking enabled
-
addRowProducer
public RowProducer addRowProducer(String stepname, int copynr) throws org.pentaho.di.core.exception.KettleException This adds a row producer to the transformation that just got set up. It is preferable to run this BEFORE execute() but after prepareExecution()- Parameters:
stepname
- The step to produce rows forcopynr
- The copynr of the step to produce row for (normally 0 unless you have multiple copies running)- Returns:
- the row producer
- Throws:
org.pentaho.di.core.exception.KettleException
- in case the thread/step to produce rows for could not be found.- See Also:
-
getParentJob
Gets the parent job, or null if there is no parent.- Returns:
- the parent job, or null if there is no parent
-
setParentJob
Sets the parent job for the transformation.- Parameters:
parentJob
- The parent job to set
-
getStepDataInterface
Finds the StepDataInterface (currently) associated with the specified step.- Parameters:
stepname
- The name of the step to look forstepcopy
- The copy number (0 based) of the step- Returns:
- The StepDataInterface or null if non found.
-
hasHaltedSteps
public boolean hasHaltedSteps()Checks whether the transformation has any steps that are halted.- Returns:
- true if one or more steps are halted, false otherwise
-
getJobStartDate
Gets the job start date.- Returns:
- the job start date
-
getJobEndDate
Gets the job end date.- Returns:
- the job end date
-
setJobEndDate
Sets the job end date.- Parameters:
jobEndDate
- the jobEndDate to set
-
setJobStartDate
Sets the job start date.- Parameters:
jobStartDate
- the jobStartDate to set
-
getPassedBatchId
public long getPassedBatchId()Get the batch ID that is passed from the parent job to the transformation. If nothing is passed, it's the transformation's batch ID- Returns:
- the parent job's batch ID, or the transformation's batch ID if there is no parent job
-
setPassedBatchId
public void setPassedBatchId(long jobBatchId) Sets the passed batch ID of the transformation from the batch ID of the parent job.- Parameters:
jobBatchId
- the jobBatchId to set
-
getBatchId
public long getBatchId()Gets the batch ID of the transformation.- Returns:
- the batch ID of the transformation
-
setBatchId
public void setBatchId(long batchId) Sets the batch ID of the transformation.- Parameters:
batchId
- the batch ID to set
-
getThreadName
Deprecated.Gets the name of the thread that contains the transformation.- Returns:
- the thread name
-
setThreadName
Deprecated.Sets the thread name for the transformation.- Parameters:
threadName
- the thread name
-
getStatus
Gets the status of the transformation (Halting, Finished, Paused, etc.)- Returns:
- the status of the transformation
-
isInitializing
public boolean isInitializing()Checks whether the transformation is initializing.- Returns:
- true if the transformation is initializing, false otherwise
-
setInitializing
public void setInitializing(boolean initializing) Sets whether the transformation is initializing.- Parameters:
initializing
- true if the transformation is initializing, false otherwise
-
isPreparing
public boolean isPreparing()Checks whether the transformation is preparing for execution.- Returns:
- true if the transformation is preparing for execution, false otherwise
-
setPreparing
public void setPreparing(boolean preparing) Sets whether the transformation is preparing for execution.- Parameters:
preparing
- true if the transformation is preparing for execution, false otherwise
-
isRunning
public boolean isRunning()Checks whether the transformation is running.- Returns:
- true if the transformation is running, false otherwise
-
setRunning
public void setRunning(boolean running) Sets whether the transformation is running.- Parameters:
running
- true if the transformation is running, false otherwise
-
executeClustered
public static TransSplitter executeClustered(TransMeta transMeta, TransExecutionConfiguration executionConfiguration) throws org.pentaho.di.core.exception.KettleException Execute the transformation in a clustered fashion. The transformation steps are split and collected in a TransSplitter object- Parameters:
transMeta
- the transformation's meta-dataexecutionConfiguration
- the execution configuration- Returns:
- the transformation splitter object
- Throws:
org.pentaho.di.core.exception.KettleException
- the kettle exception
-
executeClustered
public static void executeClustered(TransSplitter transSplitter, TransExecutionConfiguration executionConfiguration) throws org.pentaho.di.core.exception.KettleException Executes an existing TransSplitter, with the transformation already split.- Parameters:
transSplitter
- the trans splitterexecutionConfiguration
- the execution configuration- Throws:
org.pentaho.di.core.exception.KettleException
- the kettle exception- See Also:
-
org.pentaho.di.ui.spoon.delegates.SpoonTransformationDelegate
-
monitorClusteredTransformation
public static final long monitorClusteredTransformation(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob) Monitors a clustered transformation every second, after all the transformations in a cluster schema are running.
Now we should verify that they are all running as they should.
If a transformation has an error, we should kill them all.
This should happen in a separate thread to prevent blocking of the UI.
When the master and slave transformations have all finished, we should also run
a cleanup on those transformations to release sockets, etc.
- Parameters:
log
- the log interface channeltransSplitter
- the transformation splitter objectparentJob
- the parent job when executed in a job, otherwise just set to null- Returns:
- the number of errors encountered
-
monitorClusteredTransformation
public static final long monitorClusteredTransformation(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob, int sleepTimeSeconds) Monitors a clustered transformation every second, after all the transformations in a cluster schema are running.
Now we should verify that they are all running as they should.
If a transformation has an error, we should kill them all.
This should happen in a separate thread to prevent blocking of the UI.
When the master and slave transformations have all finished, we should also run
a cleanup on those transformations to release sockets, etc.
- Parameters:
log
- the subject to use for loggingtransSplitter
- the transformation splitter objectparentJob
- the parent job when executed in a job, otherwise just set to nullsleepTimeSeconds
- the sleep time in seconds in between slave transformation status polling- Returns:
- the number of errors encountered
-
cleanupCluster
public static int cleanupCluster(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter) Cleanup the cluster, including the master and all slaves, and return the number of errors that occurred.- Parameters:
log
- the log channel interfacetransSplitter
- the TransSplitter object- Returns:
- the number of errors that occurred in the clustered transformation
-
cleanupSlaveServer
public static void cleanupSlaveServer(TransSplitter transSplitter, SlaveServer slaveServer, TransMeta slaveTransMeta) throws org.pentaho.di.core.exception.KettleException Cleanup the slave server as part of a clustered transformation.- Parameters:
transSplitter
- the TransSplitter objectslaveServer
- the slave serverslaveTransMeta
- the slave transformation meta-data- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during cleanup
-
getClusteredTransformationResult
public static final org.pentaho.di.core.Result getClusteredTransformationResult(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob) Gets the clustered transformation result.- Parameters:
log
- the log channel interfacetransSplitter
- the TransSplitter objectparentJob
- the parent job- Returns:
- the clustered transformation result
-
getClusteredTransformationResult
public static final org.pentaho.di.core.Result getClusteredTransformationResult(org.pentaho.di.core.logging.LogChannelInterface log, TransSplitter transSplitter, Job parentJob, boolean loggingRemoteWork) Gets the clustered transformation result.- Parameters:
log
- the log channel interfacetransSplitter
- the TransSplitter objectparentJob
- the parent jobloggingRemoteWork
- log remote execution logs locally- Returns:
- the clustered transformation result
-
sendToSlaveServer
public static String sendToSlaveServer(TransMeta transMeta, TransExecutionConfiguration executionConfiguration, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleException Send the transformation for execution to a Carte slave server.- Parameters:
transMeta
- the transformation meta-dataexecutionConfiguration
- the transformation execution configurationrepository
- the repository- Returns:
- The Carte object ID on the server.
- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the dispatch to the slave server
-
isReadyToStart
public boolean isReadyToStart()Checks whether the transformation is ready to start (i.e. execution preparation was successful)- Returns:
- true if the transformation was prepared for execution successfully, false otherwise
- See Also:
-
setReadyToStart
protected void setReadyToStart(boolean ready) -
setInternalKettleVariables
public void setInternalKettleVariables(org.pentaho.di.core.variables.VariableSpace var) Sets the internal kettle variables.- Parameters:
var
- the new internal kettle variables
-
setInternalEntryCurrentDirectory
protected void setInternalEntryCurrentDirectory(boolean hasFilename, boolean hasRepoDir) -
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space) Copies variables from a given variable space to this transformation.- Specified by:
copyVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
space
- the variable space- See Also:
-
VariableSpace.copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace)
-
environmentSubstitute
Substitutes any variable values into the given string, and returns the resolved string.- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
aString
- the string to resolve against environment variables- Returns:
- the string after variables have been resolved/susbstituted
- See Also:
-
VariableSpace.environmentSubstitute(java.lang.String)
-
environmentSubstitute
Substitutes any variable values into each of the given strings, and returns an array containing the resolved string(s).- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
aString
- an array of strings to resolve against environment variables- Returns:
- the array of strings after variables have been resolved/susbstituted
- See Also:
-
VariableSpace.environmentSubstitute(java.lang.String[])
-
fieldSubstitute
public String fieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData) throws org.pentaho.di.core.exception.KettleValueException - Specified by:
fieldSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Throws:
org.pentaho.di.core.exception.KettleValueException
-
getParentVariableSpace
public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()Gets the parent variable space.- Specified by:
getParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- the parent variable space
- See Also:
-
VariableSpace.getParentVariableSpace()
-
setParentVariableSpace
public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent) Sets the parent variable space.- Specified by:
setParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
parent
- the new parent variable space- See Also:
-
VariableSpace.setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace)
-
getVariable
Gets the value of the specified variable, or returns a default value if no such variable exists.- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
variableName
- the variable namedefaultValue
- the default value- Returns:
- the value of the specified variable, or returns a default value if no such variable exists
- See Also:
-
VariableSpace.getVariable(java.lang.String, java.lang.String)
-
getVariable
Gets the value of the specified variable, or returns a default value if no such variable exists.- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
variableName
- the variable name- Returns:
- the value of the specified variable, or returns a default value if no such variable exists
- See Also:
-
VariableSpace.getVariable(java.lang.String)
-
getBooleanValueOfVariable
Returns a boolean representation of the specified variable after performing any necessary substitution. Truth values include case-insensitive versions of "Y", "YES", "TRUE" or "1".- Specified by:
getBooleanValueOfVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
variableName
- the variable namedefaultValue
- the default value- Returns:
- a boolean representation of the specified variable after performing any necessary substitution
- See Also:
-
VariableSpace.getBooleanValueOfVariable(java.lang.String, boolean)
-
initializeVariablesFrom
public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent) Sets the values of the transformation's variables to the values from the parent variables.- Specified by:
initializeVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
parent
- the parent- See Also:
-
VariableSpace.initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace)
-
listVariables
Gets a list of variable names for the transformation.- Specified by:
listVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- a list of variable names
- See Also:
-
VariableSpace.listVariables()
-
setVariable
Sets the value of the specified variable to the specified value.- Specified by:
setVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
variableName
- the variable namevariableValue
- the variable value- See Also:
-
VariableSpace.setVariable(java.lang.String, java.lang.String)
-
injectVariables
Injects variables using the given Map. The behavior should be that the properties object will be stored and at the time the VariableSpace is initialized (or upon calling this method if the space is already initialized). After injecting the link of the properties object should be removed.- Specified by:
injectVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
prop
- the property map- See Also:
-
VariableSpace.injectVariables(java.util.Map)
-
pauseRunning
public void pauseRunning()Pauses the transformation (pause all steps). -
resumeRunning
public void resumeRunning()Resumes running the transformation after a pause (resume all steps). -
isPreview
public boolean isPreview()Checks whether the transformation is being previewed.- Returns:
- true if the transformation is being previewed, false otherwise
-
setPreview
public void setPreview(boolean preview) Sets whether the transformation is being previewed.- Parameters:
preview
- true if the transformation is being previewed, false otherwise
-
getRepository
Gets the repository object for the transformation.- Returns:
- the repository
-
setRepository
Sets the repository object for the transformation.- Parameters:
repository
- the repository object to set
-
getStepPerformanceSnapShots
Gets a named list (map) of step performance snapshots.- Returns:
- a named list (map) of step performance snapshots
-
setStepPerformanceSnapShots
public void setStepPerformanceSnapShots(Map<String, List<StepPerformanceSnapShot>> stepPerformanceSnapShots) Sets the named list (map) of step performance snapshots.- Parameters:
stepPerformanceSnapShots
- a named list (map) of step performance snapshots to set
-
getTransListeners
Gets a list of the transformation listeners. Please do not attempt to modify this list externally. Returned list is mutable only for backward compatibility purposes.- Returns:
- the transListeners
-
setTransListeners
Sets the list of transformation listeners.- Parameters:
transListeners
- the transListeners to set
-
addTransListener
Adds a transformation listener.- Parameters:
transListener
- the trans listener
-
setTransStoppedListeners
Sets the list of stop-event listeners for the transformation.- Parameters:
transStoppedListeners
- the list of stop-event listeners to set
-
getTransStoppedListeners
Gets the list of stop-event listeners for the transformation. This is not concurrent safe. Please note this is mutable implementation only for backward compatibility reasons.- Returns:
- the list of stop-event listeners
-
addTransStoppedListener
Adds a stop-event listener to the transformation.- Parameters:
transStoppedListener
- the stop-event listener to add
-
isPaused
public boolean isPaused()Checks if the transformation is paused.- Returns:
- true if the transformation is paused, false otherwise
-
setPaused
public void setPaused(boolean paused) -
isStopped
public boolean isStopped()Checks if the transformation is stopped.- Returns:
- true if the transformation is stopped, false otherwise
-
setStopped
public void setStopped(boolean stopped) -
monitorRemoteTransformation
public static void monitorRemoteTransformation(org.pentaho.di.core.logging.LogChannelInterface log, String carteObjectId, String transName, SlaveServer remoteSlaveServer) Monitors a remote transformation every 5 seconds.- Parameters:
log
- the log channel interfacecarteObjectId
- the Carte object IDtransName
- the transformation nameremoteSlaveServer
- the remote slave server
-
monitorRemoteTransformation
public static void monitorRemoteTransformation(org.pentaho.di.core.logging.LogChannelInterface log, String carteObjectId, String transName, SlaveServer remoteSlaveServer, int sleepTimeSeconds) Monitors a remote transformation at the specified interval.- Parameters:
log
- the log channel interfacecarteObjectId
- the Carte object IDtransName
- the transformation nameremoteSlaveServer
- the remote slave serversleepTimeSeconds
- the sleep time (in seconds)
-
addParameterDefinition
public void addParameterDefinition(String key, String defValue, String description) throws org.pentaho.di.core.parameters.DuplicateParamException Adds a parameter definition to this transformation.- Specified by:
addParameterDefinition
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
key
- the name of the parameterdefValue
- the default value for the parameterdescription
- the description of the parameter- Throws:
org.pentaho.di.core.parameters.DuplicateParamException
- the duplicate param exception- See Also:
-
NamedParams.addParameterDefinition(java.lang.String, java.lang.String, java.lang.String)
-
getParameterDefault
public String getParameterDefault(String key) throws org.pentaho.di.core.parameters.UnknownParamException Gets the default value of the specified parameter.- Specified by:
getParameterDefault
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
key
- the name of the parameter- Returns:
- the default value of the parameter
- Throws:
org.pentaho.di.core.parameters.UnknownParamException
- if the parameter does not exist- See Also:
-
NamedParams.getParameterDefault(java.lang.String)
-
getParameterDescription
public String getParameterDescription(String key) throws org.pentaho.di.core.parameters.UnknownParamException Gets the description of the specified parameter.- Specified by:
getParameterDescription
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
key
- the name of the parameter- Returns:
- the parameter description
- Throws:
org.pentaho.di.core.parameters.UnknownParamException
- if the parameter does not exist- See Also:
-
NamedParams.getParameterDescription(java.lang.String)
-
getParameterValue
public String getParameterValue(String key) throws org.pentaho.di.core.parameters.UnknownParamException Gets the value of the specified parameter.- Specified by:
getParameterValue
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
key
- the name of the parameter- Returns:
- the parameter value
- Throws:
org.pentaho.di.core.parameters.UnknownParamException
- if the parameter does not exist- See Also:
-
NamedParams.getParameterValue(java.lang.String)
-
listParameters
Gets a list of the parameters for the transformation.- Specified by:
listParameters
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Returns:
- an array of strings containing the names of all parameters for the transformation
- See Also:
-
NamedParams.listParameters()
-
setParameterValue
public void setParameterValue(String key, String value) throws org.pentaho.di.core.parameters.UnknownParamException Sets the value for the specified parameter.- Specified by:
setParameterValue
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
key
- the name of the parametervalue
- the name of the value- Throws:
org.pentaho.di.core.parameters.UnknownParamException
- if the parameter does not exist- See Also:
-
NamedParams.setParameterValue(java.lang.String, java.lang.String)
-
eraseParameters
public void eraseParameters()Remove all parameters.- Specified by:
eraseParameters
in interfaceorg.pentaho.di.core.parameters.NamedParams
- See Also:
-
NamedParams.eraseParameters()
-
clearParameters
public void clearParameters()Clear the values of all parameters.- Specified by:
clearParameters
in interfaceorg.pentaho.di.core.parameters.NamedParams
- See Also:
-
NamedParams.clearParameters()
-
activateParameters
public void activateParameters()Activates all parameters by setting their values. If no values already exist, the method will attempt to set the parameter to the default value. If no default value exists, the method will set the value of the parameter to the empty string ("").- Specified by:
activateParameters
in interfaceorg.pentaho.di.core.parameters.NamedParams
- See Also:
-
NamedParams.activateParameters()
-
copyParametersFrom
public void copyParametersFrom(org.pentaho.di.core.parameters.NamedParams params) Copy parameters from a NamedParams object.- Specified by:
copyParametersFrom
in interfaceorg.pentaho.di.core.parameters.NamedParams
- Parameters:
params
- the NamedParams object from which to copy the parameters- See Also:
-
NamedParams.copyParametersFrom(org.pentaho.di.core.parameters.NamedParams)
-
mergeParametersWith
public void mergeParametersWith(org.pentaho.di.core.parameters.NamedParams params, boolean replace) - Specified by:
mergeParametersWith
in interfaceorg.pentaho.di.core.parameters.NamedParams
-
getParentTrans
Gets the parent transformation, which is null if no parent transformation exists.- Returns:
- a reference to the parent transformation's Trans object, or null if no parent transformation exists
-
setParentTrans
Sets the parent transformation.- Parameters:
parentTrans
- the parentTrans to set
-
getMappingStepName
Gets the mapping step name.- Returns:
- the name of the mapping step that created this transformation
-
setMappingStepName
Sets the mapping step name.- Parameters:
mappingStepName
- the name of the mapping step that created this transformation
-
setSocketRepository
Sets the socket repository.- Parameters:
socketRepository
- the new socket repository
-
getSocketRepository
Gets the socket repository.- Returns:
- the socket repository
-
getObjectName
Gets the object name.- Specified by:
getObjectName
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the object name
- See Also:
-
LoggingObjectInterface.getObjectName()
-
getObjectCopy
Gets the object copy. For Trans, this always returns null- Specified by:
getObjectCopy
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- null
- See Also:
-
LoggingObjectInterface.getObjectCopy()
-
getFilename
Gets the filename of the transformation, or null if no filename exists- Specified by:
getFilename
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the filename
- See Also:
-
LoggingObjectInterface.getFilename()
-
getLogChannelId
Gets the log channel ID.- Specified by:
getLogChannelId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the log channel ID
- See Also:
-
LoggingObjectInterface.getLogChannelId()
-
getObjectId
public org.pentaho.di.repository.ObjectId getObjectId()Gets the object ID.- Specified by:
getObjectId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the object ID
- See Also:
-
LoggingObjectInterface.getObjectId()
-
getObjectRevision
public org.pentaho.di.repository.ObjectRevision getObjectRevision()Gets the object revision.- Specified by:
getObjectRevision
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the object revision
- See Also:
-
LoggingObjectInterface.getObjectRevision()
-
getObjectType
public org.pentaho.di.core.logging.LoggingObjectType getObjectType()Gets the object type. For Trans, this always returns LoggingObjectType.TRANS- Specified by:
getObjectType
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the object type
- See Also:
-
LoggingObjectInterface.getObjectType()
-
getParent
public org.pentaho.di.core.logging.LoggingObjectInterface getParent()Gets the parent logging object interface.- Specified by:
getParent
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the parent
- See Also:
-
LoggingObjectInterface.getParent()
-
getRepositoryDirectory
public org.pentaho.di.repository.RepositoryDirectoryInterface getRepositoryDirectory()Gets the repository directory.- Specified by:
getRepositoryDirectory
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the repository directory
- See Also:
-
LoggingObjectInterface.getRepositoryDirectory()
-
getLogLevel
public org.pentaho.di.core.logging.LogLevel getLogLevel()Gets the log level.- Specified by:
getLogLevel
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the log level
- See Also:
-
LoggingObjectInterface.getLogLevel()
-
setLogLevel
public void setLogLevel(org.pentaho.di.core.logging.LogLevel logLevel) Sets the log level.- Parameters:
logLevel
- the new log level
-
getLogBufferStartLine
public int getLogBufferStartLine()Gets the logBufferStartLine.- Returns:
- logBufferStartLine
-
setLogBufferStartLine
public void setLogBufferStartLine(int lineNr) Sets the logBufferStartLine.- Parameters:
lineNr
- the log buffer starting line for this transformation
-
setInitialLogBufferStartLine
public void setInitialLogBufferStartLine()Sets logBufferStartLine based on LoggingBuffer last line number -
getLoggingHierarchy
Gets the logging hierarchy.- Returns:
- the logging hierarchy
-
getActiveSubtransformations
Deprecated.Use: {@link #addActiveSubTransformation(String, Trans),getActiveSubTransformation(String)
,removeActiveSubTransformation(String)
instead
-
addActiveSubTransformation
-
removeActiveSubTransformation
-
getActiveSubTransformation
-
getActiveSubjobs
Gets the active sub-jobs.- Returns:
- a map (by name) of the active sub-jobs
-
getContainerObjectId
Gets the container object ID.- Specified by:
getContainerObjectId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the Carte object ID
-
setContainerObjectId
Sets the container object ID.- Parameters:
containerObjectId
- the Carte object ID to set
-
getRegistrationDate
Gets the registration date. For Trans, this always returns null- Specified by:
getRegistrationDate
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- null
-
setServletPrintWriter
Sets the servlet print writer.- Parameters:
servletPrintWriter
- the new servlet print writer
-
getServletPrintWriter
Gets the servlet print writer.- Returns:
- the servlet print writer
-
getExecutingServer
Gets the name of the executing server.- Specified by:
getExecutingServer
in interfaceExecutorInterface
- Returns:
- the executingServer
-
setExecutingServer
Sets the name of the executing server.- Specified by:
setExecutingServer
in interfaceExecutorInterface
- Parameters:
executingServer
- the executingServer to set
-
getExecutingUser
Gets the name of the executing user.- Specified by:
getExecutingUser
in interfaceExecutorInterface
- Returns:
- the executingUser
-
setExecutingUser
Sets the name of the executing user.- Specified by:
setExecutingUser
in interfaceExecutorInterface
- Parameters:
executingUser
- the executingUser to set
-
isGatheringMetrics
public boolean isGatheringMetrics()- Specified by:
isGatheringMetrics
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
setGatheringMetrics
public void setGatheringMetrics(boolean gatheringMetrics) - Specified by:
setGatheringMetrics
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
isForcingSeparateLogging
public boolean isForcingSeparateLogging()- Specified by:
isForcingSeparateLogging
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
setForcingSeparateLogging
public void setForcingSeparateLogging(boolean forcingSeparateLogging) - Specified by:
setForcingSeparateLogging
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
getResultFiles
-
setResultFiles
-
getResultRows
-
setResultRows
-
getPreviousResult
public org.pentaho.di.core.Result getPreviousResult() -
setPreviousResult
public void setPreviousResult(org.pentaho.di.core.Result previousResult) -
getCounters
-
setCounters
-
getArguments
-
setArguments
-
clearError
public void clearError()Clear the error in the transformation, clear all the rows from all the row sets, to make sure the transformation can continue with other data. This is intended for use when running single threaded. -
getTransactionId
Gets the transaction ID for the transformation.- Returns:
- the transactionId
-
setTransactionId
Sets the transaction ID for the transformation.- Parameters:
transactionId
- the transactionId to set
-
calculateTransactionId
Calculates the transaction ID for the transformation.- Returns:
- the calculated transaction ID for the transformation.
-
getMetaStore
public org.pentaho.metastore.api.IMetaStore getMetaStore() -
setMetaStore
public void setMetaStore(org.pentaho.metastore.api.IMetaStore metaStore) -
setServletReponse
public void setServletReponse(javax.servlet.http.HttpServletResponse response) Sets encoding of HttpServletResponse according to System encoding.Check if system encoding is null or an empty and set it to HttpServletResponse when not and writes error to log if null. Throw IllegalArgumentException if input parameter is null.- Parameters:
response
- the HttpServletResponse to set encoding, mayn't be null
-
getServletResponse
public javax.servlet.http.HttpServletResponse getServletResponse() -
setServletRequest
public void setServletRequest(javax.servlet.http.HttpServletRequest request) -
getServletRequest
public javax.servlet.http.HttpServletRequest getServletRequest() -
getDelegationListeners
-
setDelegationListeners
-
addDelegationListener
-
doTopologySortOfSteps
public void doTopologySortOfSteps() -
setResultRowSet
public void setResultRowSet(boolean resultRowsSet) -
isResultRowsSet
public boolean isResultRowsSet() -
isExecutingClustered
public boolean isExecutingClustered() -
setExecutingClustered
public void setExecutingClustered(boolean executingClustered) -
getExtensionDataMap
- Specified by:
getExtensionDataMap
in interfaceorg.pentaho.di.core.ExtensionDataInterface
-
startHeartbeat
-
shutdownHeartbeat
-
callBeforeLog
public void callBeforeLog()- Specified by:
callBeforeLog
in interfaceorg.pentaho.di.core.logging.LoggingObjectLifecycleInterface
-
callAfterLog
public void callAfterLog()- Specified by:
callAfterLog
in interfaceorg.pentaho.di.core.logging.LoggingObjectLifecycleInterface
-
getTransactionId()