本文整理汇总了Java中org.pentaho.di.job.Job.getJobMeta方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getJobMeta方法的具体用法?Java Job.getJobMeta怎么用?Java Job.getJobMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.job.Job
的用法示例。
在下文中一共展示了Job.getJobMeta方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobStopAll
import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
* 停止作业,包含子作业和转换 <br/>
* @author jingma
* @param job
*/
public static void jobStopAll(Job job){
job.stopAll();
JobMeta jobMeta = job.getJobMeta();
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
if(jet.getTrans()!=null){
jet.getTrans().stopAll();
}
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
if(jej.getJob()!=null){
jobStopAll(jej.getJob());
}
}
}
}
示例2: jobKillAll
import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
* 结束作业,包含子作业和转换 <br/>
* @author jingma
* @param job
*/
@SuppressWarnings("deprecation")
public static void jobKillAll(Job job){
job.stopAll();
JobMeta jobMeta = job.getJobMeta();
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
if(jet.getTrans()!=null){
jet.getTrans().killAll();
}
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
if(jej.getJob()!=null){
jobKillAll(jej.getJob());
}
}
}
//采用线程中断结束卡住的线程
if(job.getState().equals(State.BLOCKED)||job.getState().equals(State.TIMED_WAITING)){
job.stop();
}else{
job.interrupt();
}
}
示例3: verifyRecursiveExecution
import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
* Make sure that we are not loading jobs recursively...
*
* @param parentJobMeta the parent job metadata
* @param jobMeta the job metadata
* @throws KettleException in case both jobs are loaded from the same source
*/
private void verifyRecursiveExecution(Job parentJob, JobMeta jobMeta) throws KettleException {
if (parentJob==null) return; // OK!
JobMeta parentJobMeta = parentJob.getJobMeta();
if (parentJobMeta.getName()==null && jobMeta.getName()!=null) return; // OK
if (parentJobMeta.getName()!=null && jobMeta.getName()==null) return; // OK as well.
// Not from the repository? just verify the filename
//
if (jobMeta.getFilename()!=null && jobMeta.getFilename().equals(parentJobMeta.getFilename()))
{
throw new KettleException(Messages.getString("JobJobError.Recursive", jobMeta.getFilename()));
}
// Different directories: OK
if (parentJobMeta.getDirectory()==null && jobMeta.getDirectory()!=null) return;
if (parentJobMeta.getDirectory()!=null && jobMeta.getDirectory()==null) return;
if (jobMeta.getDirectory().getID() != parentJobMeta.getDirectory().getID()) return;
// Same names, same directories : loaded from same location in the repository:
// --> recursive loading taking place!
//
if (parentJobMeta.getName().equals(jobMeta.getName()))
{
throw new KettleException(Messages.getString("JobJobError.Recursive", jobMeta.getFilename()));
}
// Also compare with the grand-parent (if there is any)
verifyRecursiveExecution(parentJob.getParentJob(), jobMeta);
}
示例4: verifyRecursiveExecution
import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
* Make sure that we are not loading jobs recursively...
*
* @param parentJobMeta
* the parent job metadata
* @param jobMeta
* the job metadata
* @throws KettleException
* in case both jobs are loaded from the same source
*/
private void verifyRecursiveExecution(Job parentJob, JobMeta jobMeta) throws KettleException {
if (parentJob == null)
return; // OK!
JobMeta parentJobMeta = parentJob.getJobMeta();
if (parentJobMeta.getName() == null && jobMeta.getName() != null)
return; // OK
if (parentJobMeta.getName() != null && jobMeta.getName() == null)
return; // OK as well.
// Not from the repository? just verify the filename
//
if (jobMeta.getFilename() != null && jobMeta.getFilename().equals(parentJobMeta.getFilename())) {
throw new KettleException(BaseMessages.getString(PKG, "JobJobError.Recursive", jobMeta.getFilename()));
}
// Different directories: OK
if (parentJobMeta.getRepositoryDirectory() == null && jobMeta.getRepositoryDirectory() != null)
return;
if (parentJobMeta.getRepositoryDirectory() != null && jobMeta.getRepositoryDirectory() == null)
return;
if (jobMeta.getRepositoryDirectory().getObjectId() != parentJobMeta.getRepositoryDirectory().getObjectId())
return;
// Same names, same directories : loaded from same location in the
// repository:
// --> recursive loading taking place!
//
if (parentJobMeta.getName().equals(jobMeta.getName())) {
throw new KettleException(BaseMessages.getString(PKG, "JobJobError.Recursive", jobMeta.getFilename()));
}
// Also compare with the grand-parent (if there is any)
verifyRecursiveExecution(parentJob.getParentJob(), jobMeta);
}