|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.di.trans.Trans
public class Trans
This class is responsible for the execution of Transformations. It loads, instantiates, initializes, runs, monitors the execution of the transformation contained in the TransInfo object you feed it.
Field Summary | |
---|---|
int |
class_nr
|
static String |
CONFIGURATION_IN_EXPORT_FILENAME
|
static String |
REPLAY_DATE_FORMAT
|
static String |
STRING_FINISHED
|
static String |
STRING_HALTING
|
static String |
STRING_INITIALIZING
|
static String |
STRING_PREPARING
|
static String |
STRING_RUNNING
|
static String |
STRING_STOPPED
|
static String |
STRING_WAITING
|
static int |
TYPE_DISP_1_1
|
static int |
TYPE_DISP_1_N
|
static int |
TYPE_DISP_N_1
|
static int |
TYPE_DISP_N_M
|
static int |
TYPE_DISP_N_N
|
Constructor Summary | |
---|---|
Trans(TransMeta transMeta)
Initialize a transformation from transformation meta-data defined in memory |
|
Trans(org.pentaho.di.core.variables.VariableSpace parentVariableSpace,
Repository rep,
String name,
String dirname,
String filename)
|
Method Summary | |
---|---|
void |
activateParameters()
|
void |
addParameterDefinition(String key,
String defValue,
String description)
|
RowProducer |
addRowProducer(String stepname,
int copynr)
This adds a row producer to the transformation that just got set up. |
void |
addTransListener(TransListener transListener)
|
void |
beginProcessing()
|
void |
cleanup()
Call this method after the transformation has finished. |
void |
clearParameters()
|
void |
copyParametersFrom(org.pentaho.di.core.parameters.NamedParams params)
|
void |
copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
|
boolean |
endProcessing(String status)
|
String |
environmentSubstitute(String aString)
|
String[] |
environmentSubstitute(String[] aString)
|
void |
eraseParameters()
|
void |
execute(String[] arguments)
Execute this transformation. |
static TransSplitter |
executeClustered(TransMeta transMeta,
TransExecutionConfiguration executionConfiguration)
|
static void |
executeClustered(TransSplitter transSplitter,
TransExecutionConfiguration executionConfiguration)
executes an existing transSplitter, with transformation already split. |
List<BaseStep> |
findBaseSteps(String stepname)
|
StepDataInterface |
findDataInterface(String name)
|
MappingInput[] |
findMappingInput()
|
MappingOutput[] |
findMappingOutput()
|
org.pentaho.di.core.RowSet |
findRowSet(String rowsetname)
|
org.pentaho.di.core.RowSet |
findRowSet(String from,
int fromcopy,
String to,
int tocopy)
|
BaseStep |
findRunThread(String stepname)
|
long |
getBatchId()
|
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue)
|
static org.pentaho.di.core.Result |
getClusteredTransformationResult(String logSubject,
TransSplitter transSplitter,
Job parentJob)
|
Date |
getCurrentDate()
|
Date |
getDepDate()
|
Date |
getEndDate()
|
int |
getEnded()
|
int |
getErrors()
|
Date |
getJobEndDate()
|
Date |
getJobStartDate()
|
long |
getLastProcessed()
|
Date |
getLogDate()
|
String |
getMappingStepName()
|
String |
getName()
|
String |
getParameterDefault(String key)
|
String |
getParameterDescription(String key)
|
String |
getParameterValue(String key)
|
Job |
getParentJob()
|
Trans |
getParentTrans()
|
org.pentaho.di.core.variables.VariableSpace |
getParentVariableSpace()
|
long |
getPassedBatchId()
|
Date |
getReplayDate()
|
Repository |
getRepository()
|
org.pentaho.di.core.Result |
getResult()
|
List<org.pentaho.di.core.RowSet> |
getRowsets()
|
BaseStep |
getRunThread(int i)
|
BaseStep |
getRunThread(String name,
int copy)
|
SocketRepository |
getSocketRepository()
|
Date |
getStartDate()
|
String |
getStatus()
|
StepDataInterface |
getStepDataInterface(String stepname,
int stepcopy)
Finds the StepDataInterface (currently) associated with the specified step |
StepInterface |
getStepInterface(String stepname,
int copy)
Find the StepInterface (thread) by looking it up using the name |
Map<String,List<StepPerformanceSnapShot>> |
getStepPerformanceSnapShots()
|
List<StepMetaDataCombi> |
getSteps()
|
String |
getThreadName()
|
List<TransListener> |
getTransListeners()
|
TransMeta |
getTransMeta()
|
String |
getVariable(String variableName)
|
String |
getVariable(String variableName,
String defaultValue)
|
boolean |
hasHaltedSteps()
|
boolean |
hasStepStarted(String sname,
int copy)
|
void |
initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
|
void |
injectVariables(Map<String,String> prop)
|
boolean |
isFinished()
|
boolean |
isInitializing()
|
boolean |
isMonitored()
|
boolean |
isPaused()
|
boolean |
isPreparing()
|
boolean |
isPreview()
|
boolean |
isReadyToStart()
|
boolean |
isRunning()
|
boolean |
isSafeModeEnabled()
|
boolean |
isStopped()
|
void |
killAll()
|
String[] |
listParameters()
|
String[] |
listVariables()
|
void |
logSummary(StepInterface si)
|
static long |
monitorClusteredTransformation(String logSubject,
TransSplitter transSplitter,
Job parentJob)
Consider that all the transformations in a cluster schema are running now... 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. |
static long |
monitorClusteredTransformation(String logSubject,
TransSplitter transSplitter,
Job parentJob,
int sleepTimeSeconds)
Consider that all the transformations in a cluster schema are running now... 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. |
static void |
monitorRemoteTransformation(String transName,
SlaveServer remoteSlaveServer)
|
static void |
monitorRemoteTransformation(String transName,
SlaveServer remoteSlaveServer,
int sleepTimeSeconds)
|
int |
nrActiveSteps()
|
int |
nrSteps()
|
void |
pauseRunning()
Pause the transformation (pause all steps) |
void |
prepareExecution(String[] arguments)
Prepare the execution of the transformation. |
void |
printStats(int seconds)
|
void |
resumeRunning()
Resume running the transformation after a pause (resume all steps) |
static void |
sendToSlaveServer(TransMeta transMeta,
TransExecutionConfiguration executionConfiguration,
Repository repository)
|
void |
setBatchId(long batchId)
|
void |
setInitializing(boolean initializing)
|
void |
setInternalKettleVariables(org.pentaho.di.core.variables.VariableSpace var)
|
void |
setJobEndDate(Date jobEndDate)
|
void |
setJobStartDate(Date jobStartDate)
|
void |
setMappingStepName(String mappingStepName)
|
void |
setMonitored(boolean monitored)
|
void |
setParameterValue(String key,
String value)
|
void |
setParentJob(Job parentJob)
|
void |
setParentTrans(Trans parentTrans)
|
void |
setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
|
void |
setPassedBatchId(long jobBatchId)
|
void |
setPreparing(boolean preparing)
|
void |
setPreview(boolean preview)
|
void |
setReplayDate(Date replayDate)
|
void |
setRepository(Repository repository)
|
void |
setRunning(boolean running)
|
void |
setSafeModeEnabled(boolean safeModeEnabled)
Turn on safe mode during running: the transformation will run slower but with more checking enabled. |
void |
setSocketRepository(SocketRepository socketRepository)
|
void |
setStepPerformanceSnapShots(Map<String,List<StepPerformanceSnapShot>> stepPerformanceSnapShots)
|
void |
setThreadName(String threadName)
|
void |
setTransListeners(List<TransListener> transListeners)
|
void |
setTransMeta(TransMeta transMeta)
|
void |
setVariable(String variableName,
String variableValue)
|
void |
shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
|
void |
startThreads()
Start the threads prepared by prepareThreads(); Before you start the threads, you can add RowListeners to them. |
void |
stopAll()
|
String |
toString()
|
void |
waitUntilFinished()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REPLAY_DATE_FORMAT
public int class_nr
public static final int TYPE_DISP_1_1
public static final int TYPE_DISP_1_N
public static final int TYPE_DISP_N_1
public static final int TYPE_DISP_N_N
public static final int TYPE_DISP_N_M
public static final String STRING_FINISHED
public static final String STRING_RUNNING
public static final String STRING_PREPARING
public static final String STRING_INITIALIZING
public static final String STRING_WAITING
public static final String STRING_STOPPED
public static final String STRING_HALTING
public static final String CONFIGURATION_IN_EXPORT_FILENAME
Constructor Detail |
---|
public Trans(TransMeta transMeta)
transMeta
- the transformation meta-data to use.public Trans(org.pentaho.di.core.variables.VariableSpace parentVariableSpace, Repository rep, String name, String dirname, String filename) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
Method Detail |
---|
public String getName()
public void execute(String[] arguments) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
- in case the transformation could not be prepared (initialized)public void prepareExecution(String[] arguments) throws org.pentaho.di.core.exception.KettleException
arguments
- the arguments to use for this transformation
org.pentaho.di.core.exception.KettleException
- in case the transformation could not be prepared (initialized)public void startThreads() throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
- in case there is a communication error with a remote output socket.public void cleanup()
public void logSummary(StepInterface si)
public void waitUntilFinished()
public int getErrors()
public int getEnded()
public boolean isFinished()
public void killAll()
public void printStats(int seconds)
public long getLastProcessed()
public org.pentaho.di.core.RowSet findRowSet(String rowsetname)
public org.pentaho.di.core.RowSet findRowSet(String from, int fromcopy, String to, int tocopy)
public boolean hasStepStarted(String sname, int copy)
public void stopAll()
public int nrSteps()
public int nrActiveSteps()
public BaseStep getRunThread(int i)
public BaseStep getRunThread(String name, int copy)
public void beginProcessing() throws org.pentaho.di.core.exception.KettleTransException
org.pentaho.di.core.exception.KettleTransException
public org.pentaho.di.core.Result getResult()
public boolean endProcessing(String status) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public BaseStep findRunThread(String stepname)
public List<BaseStep> findBaseSteps(String stepname)
public StepDataInterface findDataInterface(String name)
public Date getStartDate()
public Date getEndDate()
public boolean isMonitored()
public void setMonitored(boolean monitored)
monitored
- Indicate we want to monitor the running transformationpublic TransMeta getTransMeta()
public void setTransMeta(TransMeta transMeta)
transMeta
- The transMeta to set.public Date getCurrentDate()
public Date getDepDate()
public Date getLogDate()
public List<org.pentaho.di.core.RowSet> getRowsets()
public List<StepMetaDataCombi> getSteps()
public String toString()
toString
in class Object
public MappingInput[] findMappingInput()
public MappingOutput[] findMappingOutput()
public StepInterface getStepInterface(String stepname, int copy)
stepname
- The name of the step to look forcopy
- the copy number of the step to look for
public Date getReplayDate()
public void setReplayDate(Date replayDate)
public void setSafeModeEnabled(boolean safeModeEnabled)
safeModeEnabled
- true for safe modepublic boolean isSafeModeEnabled()
public RowProducer addRowProducer(String stepname, int copynr) throws org.pentaho.di.core.exception.KettleException
stepname
- The step to produce rows forcopynr
- The copynr of the step to produce row for (normally 0 unless you have multiple copies running)
org.pentaho.di.core.exception.KettleException
- in case the thread/step to produce rows for could not be found.public Job getParentJob()
public void setParentJob(Job parentJob)
parentJob
- The parentJob to set.public StepDataInterface getStepDataInterface(String stepname, int stepcopy)
stepname
- The name of the step to look forstepcopy
- The copy number (0 based) of the step
public boolean hasHaltedSteps()
public Date getJobStartDate()
public Date getJobEndDate()
public void setJobEndDate(Date jobEndDate)
jobEndDate
- the jobEndDate to setpublic void setJobStartDate(Date jobStartDate)
jobStartDate
- the jobStartDate to setpublic long getPassedBatchId()
public void setPassedBatchId(long jobBatchId)
jobBatchId
- the jobBatchId to setpublic long getBatchId()
public void setBatchId(long batchId)
batchId
- the batchId to setpublic String getThreadName()
public void setThreadName(String threadName)
threadName
- the threadName to setpublic String getStatus()
public boolean isInitializing()
public void setInitializing(boolean initializing)
initializing
- the initializing to setpublic boolean isPreparing()
public void setPreparing(boolean preparing)
preparing
- the preparing to setpublic boolean isRunning()
public void setRunning(boolean running)
running
- the running to setpublic static final TransSplitter executeClustered(TransMeta transMeta, TransExecutionConfiguration executionConfiguration) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public static final void executeClustered(TransSplitter transSplitter, TransExecutionConfiguration executionConfiguration) throws org.pentaho.di.core.exception.KettleException
transSplitter
- executionConfiguration
-
org.pentaho.di.core.exception.KettleException
public static final long monitorClusteredTransformation(String logSubject, TransSplitter transSplitter, Job parentJob)
logSubject
- 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
public static final long monitorClusteredTransformation(String logSubject, TransSplitter transSplitter, Job parentJob, int sleepTimeSeconds)
logSubject
- 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
public static final org.pentaho.di.core.Result getClusteredTransformationResult(String logSubject, TransSplitter transSplitter, Job parentJob)
public static void sendToSlaveServer(TransMeta transMeta, TransExecutionConfiguration executionConfiguration, Repository repository) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public boolean isReadyToStart()
prepareExecution(String[])
public void setInternalKettleVariables(org.pentaho.di.core.variables.VariableSpace var)
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
copyVariablesFrom
in interface org.pentaho.di.core.variables.VariableSpace
public String environmentSubstitute(String aString)
environmentSubstitute
in interface org.pentaho.di.core.variables.VariableSpace
public String[] environmentSubstitute(String[] aString)
environmentSubstitute
in interface org.pentaho.di.core.variables.VariableSpace
public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
getParentVariableSpace
in interface org.pentaho.di.core.variables.VariableSpace
public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
setParentVariableSpace
in interface org.pentaho.di.core.variables.VariableSpace
public String getVariable(String variableName, String defaultValue)
getVariable
in interface org.pentaho.di.core.variables.VariableSpace
public String getVariable(String variableName)
getVariable
in interface org.pentaho.di.core.variables.VariableSpace
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
getBooleanValueOfVariable
in interface org.pentaho.di.core.variables.VariableSpace
public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
initializeVariablesFrom
in interface org.pentaho.di.core.variables.VariableSpace
public String[] listVariables()
listVariables
in interface org.pentaho.di.core.variables.VariableSpace
public void setVariable(String variableName, String variableValue)
setVariable
in interface org.pentaho.di.core.variables.VariableSpace
public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
shareVariablesWith
in interface org.pentaho.di.core.variables.VariableSpace
public void injectVariables(Map<String,String> prop)
injectVariables
in interface org.pentaho.di.core.variables.VariableSpace
public void pauseRunning()
public void resumeRunning()
public boolean isPreview()
public void setPreview(boolean preview)
preview
- the preview to setpublic Repository getRepository()
public void setRepository(Repository repository)
repository
- the repository to setpublic Map<String,List<StepPerformanceSnapShot>> getStepPerformanceSnapShots()
public void setStepPerformanceSnapShots(Map<String,List<StepPerformanceSnapShot>> stepPerformanceSnapShots)
stepPerformanceSnapShots
- the stepPerformanceSnapShots to setpublic List<TransListener> getTransListeners()
public void setTransListeners(List<TransListener> transListeners)
transListeners
- the transListeners to setpublic void addTransListener(TransListener transListener)
public boolean isPaused()
public boolean isStopped()
public static void monitorRemoteTransformation(String transName, SlaveServer remoteSlaveServer)
public static void monitorRemoteTransformation(String transName, SlaveServer remoteSlaveServer, int sleepTimeSeconds)
public void addParameterDefinition(String key, String defValue, String description) throws org.pentaho.di.core.parameters.DuplicateParamException
addParameterDefinition
in interface org.pentaho.di.core.parameters.NamedParams
org.pentaho.di.core.parameters.DuplicateParamException
public String getParameterDefault(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterDefault
in interface org.pentaho.di.core.parameters.NamedParams
org.pentaho.di.core.parameters.UnknownParamException
public String getParameterDescription(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterDescription
in interface org.pentaho.di.core.parameters.NamedParams
org.pentaho.di.core.parameters.UnknownParamException
public String getParameterValue(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterValue
in interface org.pentaho.di.core.parameters.NamedParams
org.pentaho.di.core.parameters.UnknownParamException
public String[] listParameters()
listParameters
in interface org.pentaho.di.core.parameters.NamedParams
public void setParameterValue(String key, String value) throws org.pentaho.di.core.parameters.UnknownParamException
setParameterValue
in interface org.pentaho.di.core.parameters.NamedParams
org.pentaho.di.core.parameters.UnknownParamException
public void eraseParameters()
eraseParameters
in interface org.pentaho.di.core.parameters.NamedParams
public void clearParameters()
clearParameters
in interface org.pentaho.di.core.parameters.NamedParams
public void activateParameters()
activateParameters
in interface org.pentaho.di.core.parameters.NamedParams
public void copyParametersFrom(org.pentaho.di.core.parameters.NamedParams params)
copyParametersFrom
in interface org.pentaho.di.core.parameters.NamedParams
public Trans getParentTrans()
public void setParentTrans(Trans parentTrans)
parentTrans
- the parentTrans to setpublic String getMappingStepName()
public void setMappingStepName(String mappingStepName)
mappingStepName
- the name of the mapping step that created this transformationpublic void setSocketRepository(SocketRepository socketRepository)
public SocketRepository getSocketRepository()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |