|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.pentaho.di.job.Job
public class Job
This class executes a JobInfo object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
CONFIGURATION_IN_EXPORT_FILENAME
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Job()
Empty constructor, for Class.newInstance() |
|
Job(Repository repository,
JobMeta jobMeta)
|
|
Job(Repository repository,
JobMeta jobMeta,
LoggingObjectInterface parentLogging)
|
|
Job(String name,
String file,
String[] args)
|
Method Summary | |
---|---|
void |
activateParameters()
Activate the currently set parameters |
void |
addErrors(int nrToAdd)
Add a number of errors to the total number of erros that occured during execution. |
void |
addJobEntryListener(JobEntryListener jobEntryListener)
|
void |
addJobListener(JobListener jobListener)
Add a job listener to the job |
void |
addParameterDefinition(String key,
String defValue,
String description)
Add a parameter definition to this set. |
boolean |
beginProcessing()
Handle logging at start |
void |
clearParameters()
Clear all parameters |
void |
copyParametersFrom(NamedParams params)
Copy params to these named parameters (clearing out first). |
void |
copyVariablesFrom(VariableSpace space)
Copy the variables from another space, without initializing with the defaults. |
static Job |
createJobWithNewClassLoader()
|
String |
environmentSubstitute(String aString)
Substitute the string using the current variable space. |
String[] |
environmentSubstitute(String[] aString)
Replaces environment variables in an array of strings. |
void |
eraseParameters()
Clear the values. |
Result |
execute(int nr,
Result result)
Execute a job with previous results passed in. Execute called by JobEntryJob: don't clear the jobEntryResults. |
void |
fireJobListeners()
Sets the finished flag. Then launch all the job listeners and call the jobFinished method for each. |
Map<JobEntryCopy,JobEntryJob> |
getActiveJobEntryJobs()
|
Map<JobEntryCopy,JobEntryTrans> |
getActiveJobEntryTransformations()
|
long |
getBatchId()
|
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue)
This method returns a boolean for the new variable check boxes. |
String |
getContainerObjectId()
|
Date |
getCurrentDate()
|
Date |
getDepDate()
|
Date |
getEndDate()
|
int |
getErrors()
Get the number of errors that happened in the job. |
String |
getFilename()
|
List<JobEntryListener> |
getJobEntryListeners()
|
List<JobEntryResult> |
getJobEntryResults()
|
List<JobListener> |
getJobListeners()
|
JobMeta |
getJobMeta()
|
String |
getJobname()
|
JobTracker |
getJobTracker()
|
LogChannelInterface |
getLogChannel()
|
String |
getLogChannelId()
|
Date |
getLogDate()
|
List<LoggingHierarchy> |
getLoggingHierarchy()
|
LogLevel |
getLogLevel()
|
String |
getObjectCopy()
|
ObjectId |
getObjectId()
|
String |
getObjectName()
|
ObjectRevision |
getObjectRevision()
|
LoggingObjectType |
getObjectType()
|
String |
getParameterDefault(String key)
Get the default value of a parameter. |
String |
getParameterDescription(String key)
Get the description of a parameter. |
String |
getParameterValue(String key)
Get the value of a parameter. |
LoggingObjectInterface |
getParent()
|
Job |
getParentJob()
|
LoggingObjectInterface |
getParentLoggingObject()
|
VariableSpace |
getParentVariableSpace()
Get the parent of the variable space. |
long |
getPassedBatchId()
|
Date |
getRegistrationDate()
Stub |
Repository |
getRep()
|
RepositoryDirectoryInterface |
getRepositoryDirectory()
|
Result |
getResult()
|
SocketRepository |
getSocketRepository()
|
List<RowMetaAndData> |
getSourceRows()
|
Date |
getStartDate()
|
JobEntryCopy |
getStartJobEntryCopy()
|
String |
getStatus()
|
Thread |
getThread()
|
String |
getVariable(String variableName)
Get the value of a variable. |
String |
getVariable(String variableName,
String defaultValue)
Get the value of a variable with a default in case the variable is not found. |
void |
init()
|
void |
initializeVariablesFrom(VariableSpace parent)
Initialize variable space using the defaults, copy over the variables from the parent (using copyVariablesFrom()), after this the "injected" variables should be inserted (injectVariables()). |
void |
injectVariables(Map<String,String> prop)
Inject variables. |
boolean |
isActive()
|
boolean |
isFinished()
|
boolean |
isInitialized()
|
boolean |
isInteractive()
|
boolean |
isStopped()
|
String[] |
listParameters()
List the parameters. |
String[] |
listVariables()
List the variables (not the values) that are currently in the variable space. |
void |
removeJobEntryListener(JobEntryListener jobEntryListener)
Remove a job entry listener from the job |
void |
removeJobListener(JobListener jobListener)
Remove a job listener from the job |
void |
resetErrors()
Set the number of occured errors to 0. |
void |
run()
|
static String |
sendToSlaveServer(JobMeta jobMeta,
JobExecutionConfiguration executionConfiguration,
Repository repository)
|
void |
setBatchId(long batchId)
|
void |
setContainerObjectId(String containerObjectId)
|
void |
setFinished(boolean finished)
|
void |
setInteractive(boolean interactive)
|
void |
setInternalKettleVariables(VariableSpace var)
|
void |
setJobTracker(JobTracker jobTracker)
|
void |
setLogLevel(LogLevel logLevel)
|
void |
setParameterValue(String key,
String value)
Set the value of a parameter. |
void |
setParentJob(Job parentJob)
|
void |
setParentVariableSpace(VariableSpace parent)
Set the parent variable space |
void |
setPassedBatchId(long jobBatchId)
|
void |
setRepository(Repository rep)
|
void |
setResult(Result result)
|
void |
setSocketRepository(SocketRepository socketRepository)
|
void |
setSourceRows(List<RowMetaAndData> sourceRows)
|
void |
setStartJobEntryCopy(JobEntryCopy startJobEntryCopy)
|
void |
setStopped(boolean stopped)
|
void |
setVariable(String variableName,
String variableValue)
Sets a variable in the Kettle Variables list. |
void |
shareVariablesWith(VariableSpace space)
Share a variable space from another variable space. |
void |
stopAll()
|
String |
toString()
|
void |
waitUntilFinished()
Wait until this job has finished. |
void |
waitUntilFinished(long maxMiliseconds)
Wait until this job has finished. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONFIGURATION_IN_EXPORT_FILENAME
Constructor Detail |
---|
public Job(String name, String file, String[] args)
public Job(Repository repository, JobMeta jobMeta)
public Job(Repository repository, JobMeta jobMeta, LoggingObjectInterface parentLogging)
public Job()
Method Detail |
---|
public void init()
public String toString()
toString
in class Thread
public static final Job createJobWithNewClassLoader() throws KettleException
KettleException
public String getJobname()
public void setRepository(Repository rep)
public void run()
run
in interface Runnable
run
in class Thread
public Result execute(int nr, Result result) throws KettleException
nr
- The job entry numberresult
- the result of the previous execution
KettleJobException
KettleException
public void fireJobListeners() throws KettleException
KettleException
JobListener.jobFinished(Job)
public void waitUntilFinished()
public void waitUntilFinished(long maxMiliseconds)
maxMiliseconds
- the maximum number of ms to waitpublic int getErrors()
public void resetErrors()
public void addErrors(int nrToAdd)
nrToAdd
- nr of errors to add.public boolean beginProcessing() throws KettleException
KettleException
public boolean isActive()
public void stopAll()
public void setStopped(boolean stopped)
public boolean isStopped()
public Date getStartDate()
public Date getEndDate()
public Date getCurrentDate()
public Date getDepDate()
public Date getLogDate()
public JobMeta getJobMeta()
public Repository getRep()
public Thread getThread()
public JobTracker getJobTracker()
public void setJobTracker(JobTracker jobTracker)
jobTracker
- The jobTracker to set.public void setSourceRows(List<RowMetaAndData> sourceRows)
public List<RowMetaAndData> getSourceRows()
public Job getParentJob()
public void setParentJob(Job parentJob)
parentJob
- The parentJob to set.public Result getResult()
public void setResult(Result result)
public boolean isInitialized()
public long getBatchId()
public void setBatchId(long batchId)
batchId
- The batchId to set.public long getPassedBatchId()
public void setPassedBatchId(long jobBatchId)
jobBatchId
- the jobBatchId to setpublic void setInternalKettleVariables(VariableSpace var)
public void copyVariablesFrom(VariableSpace space)
VariableSpace
copyVariablesFrom
in interface VariableSpace
space
- the space to copy the variables from.public String environmentSubstitute(String aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The string to substitute.
public String[] environmentSubstitute(String[] aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The array of strings that wants its variables to be replaced.
public VariableSpace getParentVariableSpace()
VariableSpace
getParentVariableSpace
in interface VariableSpace
public void setParentVariableSpace(VariableSpace parent)
VariableSpace
setParentVariableSpace
in interface VariableSpace
parent
- The parent variable space to setpublic String getVariable(String variableName, String defaultValue)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variabledefaultValue
- The default value in case the variable could not be
found
public String getVariable(String variableName)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variable
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
VariableSpace
getBooleanValueOfVariable
in interface VariableSpace
variableName
- The variable to look up.defaultValue
- The default value to return.
static method ValueMeta.convertStringToBoolean()
public void initializeVariablesFrom(VariableSpace parent)
VariableSpace
initializeVariablesFrom
in interface VariableSpace
parent
- the parent to start from, or null if root.public String[] listVariables()
VariableSpace
listVariables
in interface VariableSpace
public void setVariable(String variableName, String variableValue)
VariableSpace
setVariable
in interface VariableSpace
variableName
- The name of the variable to setvariableValue
- The value of the variable to set. If the
variableValue is null, the variable is cleared
from the list.public void shareVariablesWith(VariableSpace space)
VariableSpace
shareVariablesWith
in interface VariableSpace
space
- Variable space to be shared.public void injectVariables(Map<String,String> prop)
VariableSpace
injectVariables
in interface VariableSpace
prop
- Properties object containing key-value pairs.public String getStatus()
public static String sendToSlaveServer(JobMeta jobMeta, JobExecutionConfiguration executionConfiguration, Repository repository) throws KettleException
KettleException
public void addJobListener(JobListener jobListener)
jobListener
- the job listener to addpublic void addJobEntryListener(JobEntryListener jobEntryListener)
public void removeJobListener(JobListener jobListener)
jobListener
- the job listener to removepublic void removeJobEntryListener(JobEntryListener jobEntryListener)
jobListener
- the job entry listener to removepublic List<JobEntryListener> getJobEntryListeners()
public List<JobListener> getJobListeners()
public boolean isFinished()
public void setFinished(boolean finished)
finished
- the finished to setpublic void addParameterDefinition(String key, String defValue, String description) throws DuplicateParamException
NamedParams
addParameterDefinition
in interface NamedParams
key
- Name of the parameter.defValue
- default value.description
- Description of the parameter.
DuplicateParamException
- Upon duplicate parameter definitionspublic String getParameterDescription(String key) throws UnknownParamException
NamedParams
getParameterDescription
in interface NamedParams
key
- Key to get value for.
UnknownParamException
- Parameter 'key' is unknown.public String getParameterDefault(String key) throws UnknownParamException
NamedParams
getParameterDefault
in interface NamedParams
key
- Key to get value for.
UnknownParamException
- Parameter 'key' is unknown.public String getParameterValue(String key) throws UnknownParamException
NamedParams
getParameterValue
in interface NamedParams
key
- Key to get value for.
UnknownParamException
- Parameter 'key' is unknown.public String[] listParameters()
NamedParams
listParameters
in interface NamedParams
public void setParameterValue(String key, String value) throws UnknownParamException
NamedParams
setParameterValue
in interface NamedParams
key
- key to set value ofvalue
- value to set it to.
UnknownParamException
- Parameter 'key' is unknown.public void eraseParameters()
NamedParams
eraseParameters
in interface NamedParams
public void clearParameters()
NamedParams
clearParameters
in interface NamedParams
public void activateParameters()
NamedParams
activateParameters
in interface NamedParams
public void copyParametersFrom(NamedParams params)
NamedParams
copyParametersFrom
in interface NamedParams
params
- the parameters to copy from.public void setSocketRepository(SocketRepository socketRepository)
public SocketRepository getSocketRepository()
public LogChannelInterface getLogChannel()
getLogChannel
in interface HasLogChannelInterface
public String getObjectName()
getObjectName
in interface LoggingObjectInterface
public String getObjectCopy()
getObjectCopy
in interface LoggingObjectInterface
public String getFilename()
getFilename
in interface LoggingObjectInterface
public String getLogChannelId()
getLogChannelId
in interface LoggingObjectInterface
public ObjectId getObjectId()
getObjectId
in interface LoggingObjectInterface
public ObjectRevision getObjectRevision()
getObjectRevision
in interface LoggingObjectInterface
public LoggingObjectType getObjectType()
getObjectType
in interface LoggingObjectInterface
public LoggingObjectInterface getParent()
getParent
in interface LoggingObjectInterface
public RepositoryDirectoryInterface getRepositoryDirectory()
getRepositoryDirectory
in interface LoggingObjectInterface
public LogLevel getLogLevel()
getLogLevel
in interface LoggingObjectInterface
public void setLogLevel(LogLevel logLevel)
public List<LoggingHierarchy> getLoggingHierarchy()
public boolean isInteractive()
public void setInteractive(boolean interactive)
interactive
- the interactive to setpublic Map<JobEntryCopy,JobEntryTrans> getActiveJobEntryTransformations()
public Map<JobEntryCopy,JobEntryJob> getActiveJobEntryJobs()
public List<JobEntryResult> getJobEntryResults()
public String getContainerObjectId()
getContainerObjectId
in interface LoggingObjectInterface
public void setContainerObjectId(String containerObjectId)
containerObjectId
- the execution container object id to setpublic LoggingObjectInterface getParentLoggingObject()
public Date getRegistrationDate()
getRegistrationDate
in interface LoggingObjectInterface
public JobEntryCopy getStartJobEntryCopy()
public void setStartJobEntryCopy(JobEntryCopy startJobEntryCopy)
startJobEntryCopy
- the startJobEntryCopy to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |