public class Job extends Thread 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
The definition of a PDI job is represented by a JobMeta object. It is typically loaded from a .kjb file, a PDI repository, or it is generated dynamically. The declared parameters of the job definition are then queried using listParameters() and assigned values using calls to setParameterValue(..).
Thread.State, Thread.UncaughtExceptionHandler| 限定符和类型 | 字段和说明 |
|---|---|
protected String[] |
arguments
The command line arguments for the job.
|
static String |
CONFIGURATION_IN_EXPORT_FILENAME |
protected Job |
parentJob
The job that's launching this (sub-) job.
|
protected Trans |
parentTrans
The parent transformation
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| 构造器和说明 |
|---|
Job() |
Job(Repository repository,
JobMeta jobMeta) |
Job(Repository repository,
JobMeta jobMeta,
org.pentaho.di.core.logging.LoggingObjectInterface parentLogging) |
Job(String name,
String file,
String[] args) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
activateParameters() |
void |
addDelegationListener(DelegationListener delegationListener) |
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) |
void |
addParameterDefinition(String key,
String defValue,
String description) |
boolean |
beginProcessing()
Handle logging at start
|
void |
clearParameters() |
void |
copyParametersFrom(org.pentaho.di.core.parameters.NamedParams params) |
void |
copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space) |
protected org.pentaho.di.core.database.Database |
createDataBase(org.pentaho.di.core.database.DatabaseMeta databaseMeta) |
static Job |
createJobWithNewClassLoader() |
String |
environmentSubstitute(String aString) |
String[] |
environmentSubstitute(String[] aString) |
void |
eraseParameters() |
org.pentaho.di.core.Result |
execute(int nr,
org.pentaho.di.core.Result result)
Execute a job with previous results passed in.
|
String |
fieldSubstitute(String aString,
org.pentaho.di.core.row.RowMetaInterface rowMeta,
Object[] rowData) |
void |
fireJobFinishListeners()
Sets the finished flag.
|
void |
fireJobStartListeners()
Call all the jobStarted method for each listener.
|
Map<JobEntryCopy,JobEntryJob> |
getActiveJobEntryJobs()
Gets the activeJobEntryJobs.
|
Map<JobEntryCopy,JobEntryTrans> |
getActiveJobEntryTransformations()
Gets the activeJobEntryTransformations.
|
String[] |
getArguments() |
long |
getBatchId() |
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue) |
String |
getContainerObjectId()
Gets the carteObjectId.
|
Date |
getCurrentDate() |
List<DelegationListener> |
getDelegationListeners() |
Date |
getDepDate()
Gets the dep date.
|
Date |
getEndDate() |
int |
getErrors()
Get the number of errors that happened in the job.
|
String |
getExecutingServer()
Gets the executing server.
|
String |
getExecutingUser()
Gets the executing user.
|
Map<String,Object> |
getExtensionDataMap() |
String |
getFilename()
Gets the file name.
|
List<JobEntryListener> |
getJobEntryListeners() |
List<JobEntryResult> |
getJobEntryResults()
Gets a flat list of results in THIS job, in the order of execution of job entries.
|
List<JobListener> |
getJobListeners() |
JobMeta |
getJobMeta() |
String |
getJobname() |
JobTracker |
getJobTracker() |
org.pentaho.di.core.logging.LogChannelInterface |
getLogChannel()
Gets the log channel interface.
|
String |
getLogChannelId()
Gets the log channel id.
|
Date |
getLogDate() |
List<org.pentaho.di.core.logging.LoggingHierarchy> |
getLoggingHierarchy()
Gets the logging hierarchy.
|
org.pentaho.di.core.logging.LogLevel |
getLogLevel()
Gets the logLevel.
|
String |
getObjectCopy()
Always returns null for Job.
|
org.pentaho.di.repository.ObjectId |
getObjectId()
Gets the jobMeta's object id.
|
String |
getObjectName()
Gets the job name.
|
org.pentaho.di.repository.ObjectRevision |
getObjectRevision()
Gets the job meta's object revision.
|
org.pentaho.di.core.logging.LoggingObjectType |
getObjectType()
Gets LoggingObjectType.JOB, which is always the value for Job.
|
String |
getParameterDefault(String key) |
String |
getParameterDescription(String key) |
String |
getParameterValue(String key) |
org.pentaho.di.core.logging.LoggingObjectInterface |
getParent()
Gets parent logging object.
|
Job |
getParentJob()
Gets the parent job.
|
org.pentaho.di.core.logging.LoggingObjectInterface |
getParentLoggingObject()
Gets the parent logging object.
|
Trans |
getParentTrans() |
org.pentaho.di.core.variables.VariableSpace |
getParentVariableSpace() |
long |
getPassedBatchId() |
Date |
getRegistrationDate()
Gets the registration date.
|
Repository |
getRep() |
org.pentaho.di.repository.RepositoryDirectoryInterface |
getRepositoryDirectory()
Gets the job meta's repository directory interface.
|
org.pentaho.di.core.Result |
getResult() |
SocketRepository |
getSocketRepository()
Gets the socket repository.
|
List<org.pentaho.di.core.RowMetaAndData> |
getSourceRows()
Gets the source rows.
|
Date |
getStartDate() |
JobEntryCopy |
getStartJobEntryCopy()
Gets the start job entry copy.
|
org.pentaho.di.core.Result |
getStartJobEntryResult() |
String |
getStatus() |
Thread |
getThread() |
String |
getTransactionId()
Gets the transaction id.
|
String |
getVariable(String variableName) |
String |
getVariable(String variableName,
String defaultValue) |
void |
init() |
void |
initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent) |
void |
injectVariables(Map<String,String> prop) |
boolean |
isActive() |
boolean |
isFinished() |
boolean |
isForcingSeparateLogging() |
boolean |
isGatheringMetrics() |
boolean |
isInitialized() |
boolean |
isInteractive()
Gets the boolean value of interactive.
|
boolean |
isStopped() |
String[] |
listParameters() |
String[] |
listVariables() |
void |
mergeParametersWith(org.pentaho.di.core.parameters.NamedParams params,
boolean replace) |
void |
removeJobEntryListener(JobEntryListener jobEntryListener) |
void |
removeJobListener(JobListener jobListener) |
void |
resetErrors()
Set the number of occured errors to 0.
|
void |
run()
Threads main loop: called by Thread.start();
|
static String |
sendToSlaveServer(JobMeta jobMeta,
JobExecutionConfiguration executionConfiguration,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Send to slave server.
|
protected void |
setActive(boolean active) |
void |
setArguments(String[] arguments) |
void |
setBatchId(long batchId) |
void |
setContainerObjectId(String containerObjectId)
Sets the execution container object id (containerObjectId).
|
void |
setDelegationListeners(List<DelegationListener> delegationListeners) |
void |
setExecutingServer(String executingServer)
Sets the executing server.
|
void |
setExecutingUser(String executingUser)
Sets the executing user.
|
void |
setFinished(boolean finished) |
void |
setForcingSeparateLogging(boolean forcingSeparateLogging) |
void |
setGatheringMetrics(boolean gatheringMetrics) |
protected void |
setInitialized(boolean initialized) |
void |
setInteractive(boolean interactive)
Sets the value of interactive.
|
protected void |
setInternalEntryCurrentDirectory(boolean hasFilename,
boolean hasRepoDir) |
void |
setInternalKettleVariables(org.pentaho.di.core.variables.VariableSpace var)
Sets the internal kettle variables.
|
void |
setJobTracker(JobTracker jobTracker) |
void |
setLogLevel(org.pentaho.di.core.logging.LogLevel logLevel)
Sets the log level.
|
void |
setParameterValue(String key,
String value) |
void |
setParentJob(Job parentJob)
Sets the parent job.
|
void |
setParentTrans(Trans parentTrans) |
void |
setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent) |
void |
setPassedBatchId(long jobBatchId) |
void |
setRepository(Repository rep) |
void |
setResult(org.pentaho.di.core.Result result) |
void |
setSocketRepository(SocketRepository socketRepository)
Sets the socket repository.
|
void |
setSourceRows(List<org.pentaho.di.core.RowMetaAndData> sourceRows) |
void |
setStartJobEntryCopy(JobEntryCopy startJobEntryCopy)
Sets the start job entry copy.
|
void |
setStartJobEntryResult(org.pentaho.di.core.Result startJobEntryResult) |
void |
setStopped(boolean stopped)
Sets the stopped.
|
void |
setTransactionId(String transactionId)
Sets the transaction id.
|
void |
setVariable(String variableName,
String variableValue) |
void |
shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space) |
protected void |
shutdownHeartbeat(ExecutorService heartbeat) |
protected ExecutorService |
startHeartbeat(long intervalInSeconds) |
void |
stopAll()
Stop all activity by setting the stopped property to true.
|
String |
toString()
Gets the name property of the JobMeta property.
|
void |
waitUntilFinished()
Wait until this job has finished.
|
void |
waitUntilFinished(long maxMiliseconds)
Wait until this job has finished.
|
protected void |
writeJobEntryLogInformation()
Write job entry log information.
|
protected void |
writeLogChannelInformation()
Write log channel information.
|
protected void |
writeLogTableInformation(JobLogTable jobLogTable,
org.pentaho.di.core.logging.LogStatus status)
Writes information to Job Log table.
|
activeCount, checkAccess, clone, 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, yieldpublic static final String CONFIGURATION_IN_EXPORT_FILENAME
protected Job parentJob
protected Trans parentTrans
protected String[] arguments
public Job(Repository repository, JobMeta jobMeta)
public Job(Repository repository, JobMeta jobMeta, org.pentaho.di.core.logging.LoggingObjectInterface parentLogging)
public Job()
public void init()
public String toString()
public static final Job createJobWithNewClassLoader() throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleExceptionpublic String getJobname()
public void setRepository(Repository rep)
public void run()
public org.pentaho.di.core.Result execute(int nr,
org.pentaho.di.core.Result result)
throws org.pentaho.di.core.exception.KettleException
nr - The job entry numberresult - the result of the previous executionorg.pentaho.di.core.exception.KettleJobExceptionorg.pentaho.di.core.exception.KettleExceptionpublic void fireJobFinishListeners()
throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleExceptionJobListener.jobFinished(Job)public void fireJobStartListeners()
throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleExceptionJobListener.jobStarted(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 org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleExceptionprotected void writeLogTableInformation(JobLogTable jobLogTable, org.pentaho.di.core.logging.LogStatus status) throws org.pentaho.di.core.exception.KettleJobException, org.pentaho.di.core.exception.KettleDatabaseException
org.pentaho.di.core.exception.KettleJobExceptionorg.pentaho.di.core.exception.KettleDatabaseExceptionprotected void writeLogChannelInformation()
throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException - the kettle exceptionprotected void writeJobEntryLogInformation()
throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException - the kettle exceptionprotected org.pentaho.di.core.database.Database createDataBase(org.pentaho.di.core.database.DatabaseMeta databaseMeta)
public boolean isInitialized()
protected void setInitialized(boolean initialized)
public boolean isActive()
protected void setActive(boolean active)
public boolean isStopped()
public void stopAll()
public void setStopped(boolean stopped)
public boolean isFinished()
public void setFinished(boolean finished)
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)
public void setSourceRows(List<org.pentaho.di.core.RowMetaAndData> sourceRows)
public List<org.pentaho.di.core.RowMetaAndData> getSourceRows()
public Job getParentJob()
public void setParentJob(Job parentJob)
parentJob - The parentJob to set.public org.pentaho.di.core.Result getResult()
public void setResult(org.pentaho.di.core.Result result)
public long getBatchId()
public void setBatchId(long batchId)
public long getPassedBatchId()
public void setPassedBatchId(long jobBatchId)
public void setInternalKettleVariables(org.pentaho.di.core.variables.VariableSpace var)
var - the new internal kettle variables.protected void setInternalEntryCurrentDirectory(boolean hasFilename,
boolean hasRepoDir)
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
copyVariablesFrom 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String environmentSubstitute(String aString)
environmentSubstitute 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String[] environmentSubstitute(String[] aString)
environmentSubstitute 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String fieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData) throws org.pentaho.di.core.exception.KettleValueException
fieldSubstitute 在接口中 org.pentaho.di.core.variables.VariableSpaceorg.pentaho.di.core.exception.KettleValueExceptionpublic org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
getParentVariableSpace 在接口中 org.pentaho.di.core.variables.VariableSpacepublic void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
setParentVariableSpace 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String getVariable(String variableName, String defaultValue)
getVariable 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String getVariable(String variableName)
getVariable 在接口中 org.pentaho.di.core.variables.VariableSpacepublic boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
getBooleanValueOfVariable 在接口中 org.pentaho.di.core.variables.VariableSpacepublic void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
initializeVariablesFrom 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String[] listVariables()
listVariables 在接口中 org.pentaho.di.core.variables.VariableSpacepublic void setVariable(String variableName, String variableValue)
setVariable 在接口中 org.pentaho.di.core.variables.VariableSpacepublic void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
shareVariablesWith 在接口中 org.pentaho.di.core.variables.VariableSpacepublic void injectVariables(Map<String,String> prop)
injectVariables 在接口中 org.pentaho.di.core.variables.VariableSpacepublic String getStatus()
public static String sendToSlaveServer(JobMeta jobMeta, JobExecutionConfiguration executionConfiguration, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleException
jobMeta - the job metaexecutionConfiguration - the execution configurationrepository - the repositorymetaStore - the metaStoreorg.pentaho.di.core.exception.KettleException - the kettle exceptionpublic void addJobListener(JobListener jobListener)
public void addJobEntryListener(JobEntryListener jobEntryListener)
public void removeJobListener(JobListener jobListener)
public void removeJobEntryListener(JobEntryListener jobEntryListener)
public List<JobEntryListener> getJobEntryListeners()
public List<JobListener> getJobListeners()
public void addParameterDefinition(String key, String defValue, String description) throws org.pentaho.di.core.parameters.DuplicateParamException
addParameterDefinition 在接口中 org.pentaho.di.core.parameters.NamedParamsorg.pentaho.di.core.parameters.DuplicateParamExceptionpublic String getParameterDescription(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterDescription 在接口中 org.pentaho.di.core.parameters.NamedParamsorg.pentaho.di.core.parameters.UnknownParamExceptionpublic String getParameterDefault(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterDefault 在接口中 org.pentaho.di.core.parameters.NamedParamsorg.pentaho.di.core.parameters.UnknownParamExceptionpublic String getParameterValue(String key) throws org.pentaho.di.core.parameters.UnknownParamException
getParameterValue 在接口中 org.pentaho.di.core.parameters.NamedParamsorg.pentaho.di.core.parameters.UnknownParamExceptionpublic String[] listParameters()
listParameters 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void setParameterValue(String key, String value) throws org.pentaho.di.core.parameters.UnknownParamException
setParameterValue 在接口中 org.pentaho.di.core.parameters.NamedParamsorg.pentaho.di.core.parameters.UnknownParamExceptionpublic void eraseParameters()
eraseParameters 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void clearParameters()
clearParameters 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void activateParameters()
activateParameters 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void copyParametersFrom(org.pentaho.di.core.parameters.NamedParams params)
copyParametersFrom 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void mergeParametersWith(org.pentaho.di.core.parameters.NamedParams params,
boolean replace)
mergeParametersWith 在接口中 org.pentaho.di.core.parameters.NamedParamspublic void setSocketRepository(SocketRepository socketRepository)
socketRepository - the new socket repositorypublic SocketRepository getSocketRepository()
public org.pentaho.di.core.logging.LogChannelInterface getLogChannel()
getLogChannel 在接口中 HasLogChannelInterfacepublic String getObjectName()
getObjectName 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic String getObjectCopy()
getObjectCopy 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic String getFilename()
getFilename 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic String getLogChannelId()
getLogChannelId 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.repository.ObjectId getObjectId()
getObjectId 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.repository.ObjectRevision getObjectRevision()
getObjectRevision 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.core.logging.LoggingObjectType getObjectType()
getObjectType 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.core.logging.LoggingObjectInterface getParent()
getParent 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.repository.RepositoryDirectoryInterface getRepositoryDirectory()
getRepositoryDirectory 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic org.pentaho.di.core.logging.LogLevel getLogLevel()
getLogLevel 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic void setLogLevel(org.pentaho.di.core.logging.LogLevel logLevel)
logLevel - the new log levelpublic List<org.pentaho.di.core.logging.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 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic void setContainerObjectId(String containerObjectId)
containerObjectId - the execution container object id to setpublic org.pentaho.di.core.logging.LoggingObjectInterface getParentLoggingObject()
public Date getRegistrationDate()
getRegistrationDate 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic JobEntryCopy getStartJobEntryCopy()
public void setStartJobEntryCopy(JobEntryCopy startJobEntryCopy)
startJobEntryCopy - the startJobEntryCopy to setpublic String getExecutingServer()
getExecutingServer 在接口中 ExecutorInterfacepublic void setExecutingServer(String executingServer)
setExecutingServer 在接口中 ExecutorInterfaceexecutingServer - the executingServer to setpublic String getExecutingUser()
getExecutingUser 在接口中 ExecutorInterfacepublic void setExecutingUser(String executingUser)
setExecutingUser 在接口中 ExecutorInterfaceexecutingUser - the executingUser to setpublic boolean isGatheringMetrics()
isGatheringMetrics 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic void setGatheringMetrics(boolean gatheringMetrics)
setGatheringMetrics 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic boolean isForcingSeparateLogging()
isForcingSeparateLogging 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic void setForcingSeparateLogging(boolean forcingSeparateLogging)
setForcingSeparateLogging 在接口中 org.pentaho.di.core.logging.LoggingObjectInterfacepublic String getTransactionId()
public void setTransactionId(String transactionId)
transactionId - the transactionId to setpublic List<DelegationListener> getDelegationListeners()
public void setDelegationListeners(List<DelegationListener> delegationListeners)
public void addDelegationListener(DelegationListener delegationListener)
public String[] getArguments()
public void setArguments(String[] arguments)
public Trans getParentTrans()
public void setParentTrans(Trans parentTrans)
public Map<String,Object> getExtensionDataMap()
getExtensionDataMap 在接口中 org.pentaho.di.core.ExtensionDataInterfacepublic org.pentaho.di.core.Result getStartJobEntryResult()
public void setStartJobEntryResult(org.pentaho.di.core.Result startJobEntryResult)
protected ExecutorService startHeartbeat(long intervalInSeconds)
protected void shutdownHeartbeat(ExecutorService heartbeat)
Copyright © 2024 Hitachi Vantara. All rights reserved.