本文整理汇总了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());
}
}
}
}
示例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: 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;
}
示例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();
}
}
}