当前位置: 首页>>代码示例>>Java>>正文


Java Job.getJobMeta方法代码示例

本文整理汇总了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());
               }
           }
       }
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:23,代码来源:KettleUtils.java

示例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();
    }
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:30,代码来源:KettleUtils.java

示例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);
 	}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:40,代码来源:JobEntryJob.java

示例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);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:48,代码来源:JobEntryJob.java


注:本文中的org.pentaho.di.job.Job.getJobMeta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。