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


Java Job.stopAll方法代码示例

本文整理汇总了Java中org.pentaho.di.job.Job.stopAll方法的典型用法代码示例。如果您正苦于以下问题:Java Job.stopAll方法的具体用法?Java Job.stopAll怎么用?Java Job.stopAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.job.Job的用法示例。


在下文中一共展示了Job.stopAll方法的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: execute

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
 * Execute this job entry and return the result.
 * In this case it means, just set the result boolean in the Result class.
 * @param previousResult The result of the previous execution
 * @return The Result of the execution.
 */
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob) {
  previousResult.setResult(evaluate(previousResult));
  // we fail so stop 
  // job execution
  parentJob.stopAll();
  return previousResult;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:14,代码来源:JobEntryAbort.java

示例4: run

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
@SuppressWarnings("all")
public void run() {
	while (true) {
		try {
			if ((System.currentTimeMillis() - this.lastShowTime) > this.showTimeInterval) {
				this.lastShowTime = System.currentTimeMillis();
				int waitJobSize = Blocking.jobSize();
				System.out.println("date:" + DateUtils.getTime24()
						+ ":current waiting execed job is :"
						+ waitJobSize);
				synchronized (entityMap) {
					Iterator<String> it = entityMap.keySet().iterator();

					while (it.hasNext()) {
						String jk = it.next();
						QuartzQueue<T> rei = entityMap.get(jk);
						long rt = System.currentTimeMillis()
								- rei.getStartTime();
						if (rt > Blocking.DEFAULT_EKETTLE_JOB_RUNNING_TIME) {
							Job cjob = jobMap.remove(jk);
							if (cjob != null) {
								System.out
										.println("date:"
												+ DateUtils.getTime24()
												+ " job["
												+ jk
												+ "] is running "
												+ (rt / 1000)
												+ "s,is too long,will top the job!!");
								cjob.stopAll();
								System.out
										.println("date:"
												+ DateUtils.getTime24()
												+ " job["
												+ jk
												+ "] is stoped!!,retry to exec the job");
								Blocking.addToWaitingQueue(rei
										.getEntity());
							}

						} else {
							System.out.println("date:"
									+ DateUtils.getTime24() + " job["
									+ jk + "] is running "
									+ (rt / 1000) + "s");
						}
					}
				}

			}
			Thread.sleep(10000);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:57,代码来源:KettleJobServiceImpl.java


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