本文整理汇总了Java中org.pentaho.di.job.entries.special.JobEntrySpecial.getLogChannelId方法的典型用法代码示例。如果您正苦于以下问题:Java JobEntrySpecial.getLogChannelId方法的具体用法?Java JobEntrySpecial.getLogChannelId怎么用?Java JobEntrySpecial.getLogChannelId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.job.entries.special.JobEntrySpecial
的用法示例。
在下文中一共展示了JobEntrySpecial.getLogChannelId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.pentaho.di.job.entries.special.JobEntrySpecial; //导入方法依赖的package包/类
/**
* Execute a job without previous results. This is a job entry point (not recursive)<br>
* <br>
* @return the result of the execution
*
* @throws KettleException
*/
private Result execute() throws KettleException
{
finished.set(false);
stopped.set(false);
log.logMinimal(BaseMessages.getString(PKG, "Job.Comment.JobStarted"));
// Start the tracking...
JobEntryResult jerStart = new JobEntryResult(null, null, BaseMessages.getString(PKG, "Job.Comment.JobStarted"), BaseMessages.getString(PKG, "Job.Reason.Started"), null, 0, null);
jobTracker.addJobTracker(new JobTracker(jobMeta, jerStart));
active.set(true);
// Where do we start?
JobEntryCopy startpoint;
// synchronize this to a parent job if needed.
//
Object syncObject=this;
if (parentJob!=null) syncObject=parentJob; // parallel execution in a job
synchronized(syncObject) {
beginProcessing();
}
if (startJobEntryCopy==null) {
startpoint = jobMeta.findJobEntry(JobMeta.STRING_SPECIAL_START, 0, false);
} else {
startpoint = startJobEntryCopy;
}
if (startpoint == null) { throw new KettleJobException(BaseMessages.getString(PKG, "Job.Log.CounldNotFindStartingPoint")); }
Result res = null;
JobEntryResult jerEnd = null;
if (startpoint.isStart()) {
// Perform optional looping in the special Start job entry...
//
long iteration=0;
boolean isFirst = true;
JobEntrySpecial jes = (JobEntrySpecial) startpoint.getEntry();
while ( (jes.isRepeat() || isFirst) && !isStopped()) {
isFirst = false;
res = execute(0, null, startpoint, null, BaseMessages.getString(PKG, "Job.Reason.Started"));
if (iteration>0 && (iteration%500)==0) {
System.out.println("other 500 iterations: "+iteration);
}
iteration++;
}
jerEnd = new JobEntryResult(res, jes.getLogChannelId(), BaseMessages.getString(PKG, "Job.Comment.JobFinished"), BaseMessages.getString(PKG, "Job.Reason.Finished"), null, 0, null);
} else {
// 递归执行Job中的节点,获得最终结果
res = execute(0, null, startpoint, null, BaseMessages.getString(PKG, "Job.Reason.Started"));
jerEnd = new JobEntryResult(res, startpoint.getEntry().getLogChannel().getLogChannelId(), BaseMessages.getString(PKG, "Job.Comment.JobFinished"), BaseMessages.getString(PKG, "Job.Reason.Finished"), null, 0, null);
}
// Save this result...
jobTracker.addJobTracker(new JobTracker(jobMeta, jerEnd));
log.logMinimal(BaseMessages.getString(PKG, "Job.Comment.JobFinished"));
active.set(false);
finished.set(true);
return res;
}
示例2: execute
import org.pentaho.di.job.entries.special.JobEntrySpecial; //导入方法依赖的package包/类
/**
* Execute a job without previous results. This is a job entry point (not recursive).<br>
* <br>
* @return the result of the execution
*
* @throws KettleException
*/
private Result execute() throws KettleException
{
finished.set(false);
stopped.set(false);
log.logMinimal(BaseMessages.getString(PKG, "Job.Comment.JobStarted"));
// Start the tracking...
JobEntryResult jerStart = new JobEntryResult(null, null, BaseMessages.getString(PKG, "Job.Comment.JobStarted"), BaseMessages.getString(PKG, "Job.Reason.Started"), null, 0, null);
jobTracker.addJobTracker(new JobTracker(jobMeta, jerStart));
active.set(true);
// Where do we start?
JobEntryCopy startpoint;
// synchronize this to a parent job if needed.
//
Object syncObject=this;
if (parentJob!=null) syncObject=parentJob; // parallel execution in a job
synchronized(syncObject) {
beginProcessing();
}
if (startJobEntryCopy==null) {
startpoint = jobMeta.findJobEntry(JobMeta.STRING_SPECIAL_START, 0, false);
} else {
startpoint = startJobEntryCopy;
}
if (startpoint == null) { throw new KettleJobException(BaseMessages.getString(PKG, "Job.Log.CounldNotFindStartingPoint")); }
Result res = null;
JobEntryResult jerEnd = null;
if (startpoint.isStart()) {
// Perform optional looping in the special Start job entry...
//
long iteration=0;
boolean isFirst = true;
JobEntrySpecial jes = (JobEntrySpecial) startpoint.getEntry();
while ( (jes.isRepeat() || isFirst) && !isStopped()) {
isFirst = false;
res = execute(0, null, startpoint, null, BaseMessages.getString(PKG, "Job.Reason.Started"));
if (iteration>0 && (iteration%500)==0) {
System.out.println("other 500 iterations: "+iteration);
}
iteration++;
}
jerEnd = new JobEntryResult(res, jes.getLogChannelId(), BaseMessages.getString(PKG, "Job.Comment.JobFinished"), BaseMessages.getString(PKG, "Job.Reason.Finished"), null, 0, null);
} else {
res = execute(0, null, startpoint, null, BaseMessages.getString(PKG, "Job.Reason.Started"));
jerEnd = new JobEntryResult(res, startpoint.getEntry().getLogChannel().getLogChannelId(), BaseMessages.getString(PKG, "Job.Comment.JobFinished"), BaseMessages.getString(PKG, "Job.Reason.Finished"), null, 0, null);
}
// Save this result...
jobTracker.addJobTracker(new JobTracker(jobMeta, jerEnd));
log.logMinimal(BaseMessages.getString(PKG, "Job.Comment.JobFinished"));
active.set(false);
finished.set(true);
return res;
}