本文整理汇总了Java中org.pentaho.di.job.entry.JobEntryCopy.getEntry方法的典型用法代码示例。如果您正苦于以下问题:Java JobEntryCopy.getEntry方法的具体用法?Java JobEntryCopy.getEntry怎么用?Java JobEntryCopy.getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.job.entry.JobEntryCopy
的用法示例。
在下文中一共展示了JobEntryCopy.getEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobStopAll
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的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.entry.JobEntryCopy; //导入方法依赖的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: jobCopy
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* 将指定job复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName job名称
* @param jobPath job路径
* @param fromRepository 来源资源库
* @param toRepository 目标资源库
* @throws KettleException
*/
public static void jobCopy(String jobName,String jobPath,Repository fromRepository,
Repository toRepository) throws KettleException {
JobMeta jobMeta = KettleUtils.loadJob(jobName,jobPath,fromRepository);
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
transCopy(jet.getObjectName(), jet.getDirectory(),fromRepository,toRepository);
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
jobCopy(jej.getObjectName(),jej.getDirectory(),fromRepository,toRepository);
}
}
jobMeta.setRepository(toRepository);
jobMeta.setMetaStore(toRepository.getMetaStore());
if(!isDirectoryExist(toRepository,jobPath)){
//所在目录不存在则创建
toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), jobPath);
}
KettleUtils.saveJob(toRepository,jobMeta);
}
示例4: findStart
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* 查找JOB的开始控件 <br/>
* @author jingma
* @param jobMeta JOB元数据
* @return 开始控件
*/
public static JobEntrySpecial findStart(JobMeta jobMeta) {
for (int i = 0; i < jobMeta.nrJobEntries(); i++) {
JobEntryCopy jec = jobMeta.getJobEntry(i);
JobEntryInterface je = jec.getEntry();
if (je.getPluginId().equals("SPECIAL")) {
return (JobEntrySpecial) je;
}
}
return null;
}
示例5: execute
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* Execute a job without previous results. This is a job entry point (not recursive)<br>
* <br>
* @param fireJobListeners true if the job listeners need to be fired off
* @return the result of the execution
*
* @throws KettleException
*/
private Result execute(boolean fireJobListeners) throws KettleException
{
finished=false;
stopped=false;
// Start the tracking...
JobEntryResult jerStart = new JobEntryResult(null, Messages.getString("Job.Comment.JobStarted"), Messages.getString("Job.Reason.Started"), null);
jobTracker.addJobTracker(new JobTracker(jobMeta, jerStart));
active = true;
// Where do we start?
JobEntryCopy startpoint;
beginProcessing();
startpoint = jobMeta.findJobEntry(JobMeta.STRING_SPECIAL_START, 0, false);
if (startpoint == null) { throw new KettleJobException(Messages.getString("Job.Log.CounldNotFindStartingPoint")); }
JobEntrySpecial jes = (JobEntrySpecial) startpoint.getEntry();
Result res = null;
boolean isFirst = true;
while ( (jes.isRepeat() || isFirst) && !isStopped())
{
isFirst = false;
res = execute(0, null, startpoint, null, Messages.getString("Job.Reason.Started"));
}
// Save this result...
JobEntryResult jerEnd = new JobEntryResult(res, Messages.getString("Job.Comment.JobFinished"), Messages.getString("Job.Reason.Finished"), null);
jobTracker.addJobTracker(new JobTracker(jobMeta, jerEnd));
active = false;
// Tell the world that we've finished processing this job...
//
if (fireJobListeners) {
fireJobListeners();
}
return res;
}
示例6: findJobEntry
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
public JobEntryCopy findJobEntry(String full_name_nr) {
int i;
for (i = 0; i < nrJobEntries(); i++) {
JobEntryCopy jec = getJobEntry(i);
JobEntryInterface je = jec.getEntry();
if (je.toString().equalsIgnoreCase(full_name_nr)) {
return jec;
}
}
return null;
}
示例7: checkJobEntries
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* Check all job entries within the job. Each Job Entry has the opportunity
* to check their own settings.
*
* @param remarks
* List of CheckResult remarks inserted into by each JobEntry
* @param only_selected
* true if you only want to check the selected jobs
* @param monitor
* Progress monitor (not presently in use)
*/
public void checkJobEntries(List<CheckResultInterface> remarks, boolean only_selected, ProgressMonitorListener monitor) {
remarks.clear(); // Empty remarks
if (monitor != null)
monitor.beginTask(Messages.getString("JobMeta.Monitor.VerifyingThisJobEntryTask.Title"), jobcopies.size() + 2); //$NON-NLS-1$
boolean stop_checking = false;
for (int i = 0; i < jobcopies.size() && !stop_checking; i++) {
JobEntryCopy copy = jobcopies.get(i); // get the job entry copy
if ((!only_selected) || (only_selected && copy.isSelected())) {
JobEntryInterface entry = copy.getEntry();
if (entry != null) {
if (monitor != null)
monitor.subTask(Messages.getString("JobMeta.Monitor.VerifyingJobEntry.Title", entry.getName())); //$NON-NLS-1$ //$NON-NLS-2$
entry.check(remarks, this);
if (monitor != null) {
monitor.worked(1); // progress bar...
if (monitor.isCanceled()) {
stop_checking = true;
}
}
}
}
if (monitor != null) {
monitor.worked(1);
}
}
if (monitor != null) {
monitor.done();
}
}
示例8: getResourceDependencies
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
public List<ResourceReference> getResourceDependencies() {
List<ResourceReference> resourceReferences = new ArrayList<ResourceReference>();
JobEntryCopy copy = null;
JobEntryInterface entry = null;
for (int i = 0; i < jobcopies.size(); i++) {
copy = jobcopies.get(i); // get the job entry copy
entry = copy.getEntry();
resourceReferences.addAll(entry.getResourceDependencies(this));
}
return resourceReferences;
}
示例9: checkJobEntries
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
/**
* Check all job entries within the job. Each Job Entry has the opportunity
* to check their own settings.
*
* @param remarks
* List of CheckResult remarks inserted into by each JobEntry
* @param only_selected
* true if you only want to check the selected jobs
* @param monitor
* Progress monitor (not presently in use)
*/
public void checkJobEntries(List<CheckResultInterface> remarks, boolean only_selected, ProgressMonitorListener monitor) {
remarks.clear(); // Empty remarks
if (monitor != null)
monitor.beginTask(BaseMessages.getString(PKG, "JobMeta.Monitor.VerifyingThisJobEntryTask.Title"), jobcopies.size() + 2); //$NON-NLS-1$
boolean stop_checking = false;
for (int i = 0; i < jobcopies.size() && !stop_checking; i++) {
JobEntryCopy copy = jobcopies.get(i); // get the job entry copy
if ((!only_selected) || (only_selected && copy.isSelected())) {
JobEntryInterface entry = copy.getEntry();
if (entry != null) {
if (monitor != null)
monitor.subTask(BaseMessages.getString(PKG, "JobMeta.Monitor.VerifyingJobEntry.Title", entry.getName())); //$NON-NLS-1$ //$NON-NLS-2$
entry.check(remarks, this);
if (monitor != null) {
monitor.worked(1); // progress bar...
if (monitor.isCanceled()) {
stop_checking = true;
}
}
}
}
if (monitor != null) {
monitor.worked(1);
}
}
if (monitor != null) {
monitor.done();
}
}
示例10: addTrackerToTree
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
private void addTrackerToTree(JobTracker jobTracker, TreeItem parentItem)
{
try
{
if (jobTracker!=null)
{
TreeItem treeItem = new TreeItem(parentItem, SWT.NONE);
if (jobTracker.nrJobTrackers()>0)
{
// This is a sub-job: display the name at the top of the list...
treeItem.setText( 0, Messages.getString("JobLog.Tree.JobPrefix")+jobTracker.getJobName() ); //$NON-NLS-1$
// then populare the sub-job entries ...
for (int i=0;i<jobTracker.nrJobTrackers();i++)
{
addTrackerToTree(jobTracker.getJobTracker(i), treeItem);
}
}
else
{
JobEntryResult result = jobTracker.getJobEntryResult();
if (result!=null)
{
JobEntryCopy jec = result.getJobEntry();
if (jec!=null)
{
treeItem.setText( 0, jec.getName() );
if (jec.getEntry()!=null)
{
treeItem.setText( 4, Const.NVL( jec.getEntry().getRealFilename(), "") );
}
}
else
{
treeItem.setText( 0, Messages.getString("JobLog.Tree.JobPrefix2")+jobTracker.getJobName()); //$NON-NLS-1$
}
String comment = result.getComment();
if (comment!=null)
{
treeItem.setText(1, comment);
}
Result res = result.getResult();
if (res!=null)
{
treeItem.setText(2, res.getResult()?Messages.getString("JobLog.Tree.Success"):Messages.getString("JobLog.Tree.Failure")); //$NON-NLS-1$ //$NON-NLS-2$
treeItem.setText(5, Long.toString(res.getEntryNr())); //$NON-NLS-1$
}
String reason = result.getReason();
if (reason!=null)
{
treeItem.setText(3, reason );
}
Date logDate = result.getLogDate();
if (logDate!=null)
{
treeItem.setText(6, new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(logDate)); //$NON-NLS-1$
}
}
}
treeItem.setExpanded(true);
}
}
catch(Exception e)
{
log.logError(toString(), Const.getStackTracker(e));
}
}
示例11: editJobEntry
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
public void editJobEntry(JobMeta jobMeta, JobEntryCopy je)
{
try
{
spoon.getLog().logBasic(spoon.toString(), Messages.getString("Spoon.Log.EditJobEntry", je.getName())); //$NON-NLS-1$
JobEntryCopy before = (JobEntryCopy) je.clone_deep();
JobEntryInterface jei = je.getEntry();
if (jei.isSpecial())
{
JobEntrySpecial special = (JobEntrySpecial) jei;
if (special.isDummy())
{
return;
}
}
JobEntryDialogInterface d = getJobEntryDialog(jei, jobMeta);
if (d != null)
{
if (d.open() != null)
{
// First see if the name changed.
// If so, we need to verify that the name is not already used in the job.
//
jobMeta.renameJobEntryIfNameCollides(je);
JobEntryCopy after = (JobEntryCopy) je.clone();
spoon.addUndoChange(jobMeta, new JobEntryCopy[] { before }, new JobEntryCopy[] { after }, new int[] { jobMeta.indexOfJobEntry(je) });
spoon.refreshGraph();
spoon.refreshTree();
}
}
else
{
MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(Messages.getString("Spoon.Dialog.JobEntryCanNotBeChanged.Message")); //$NON-NLS-1$
mb.setText(Messages.getString("Spoon.Dialog.JobEntryCanNotBeChanged.Title")); //$NON-NLS-1$
mb.open();
}
} catch (Exception e)
{
if (!spoon.getShell().isDisposed())
new ErrorDialog(
spoon.getShell(),
Messages.getString("Spoon.ErrorDialog.ErrorEditingJobEntry.Title"),
Messages.getString("Spoon.ErrorDialog.ErrorEditingJobEntry.Message"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例12: JobEntryResult
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
@Deprecated
public JobEntryResult(Result result, String comment, String reason, JobEntryCopy copy) {
this(result, copy.getEntry().getLogChannel().getLogChannelId(), comment, reason, copy!=null ? copy.getName() : null, copy!=null ? copy.getNr() : 0, copy==null ? null : ( copy.getEntry()!=null ? copy.getEntry().getFilename() : null) );
}
示例13: execute
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的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;
}
示例14: saveJobEntryCopy
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
public void saveJobEntryCopy(JobEntryCopy copy, ObjectId id_job) throws KettleException
{
try
{
JobEntryInterface entry = copy.getEntry();
/*
* --1-- Save the JobEntryCopy details... --2-- If we don't find a
* id_jobentry, save the jobentry (meaning: only once)
*/
// See if an entry with the same name is already available...
ObjectId id_jobentry = getJobEntryID(copy.getName(), id_job);
if (id_jobentry == null)
{
insertJobEntry(id_job, (JobEntryBase)entry);
// THIS IS THE PLUGIN/JOB-ENTRY BEING SAVED!
//
entry.saveRep(repository, id_job);
id_jobentry = entry.getObjectId();
}
// OK, the entry is saved.
// Get the entry type...
//
ObjectId id_jobentry_type = getJobEntryTypeID(entry.getPluginId());
// Oops, not found: update the repository!
if (id_jobentry_type == null)
{
repository.updateJobEntryTypes();
// Try again!
id_jobentry_type = getJobEntryTypeID(entry.getPluginId());
}
// Save the entry copy..
//
copy.setObjectId(insertJobEntryCopy(id_job, id_jobentry, id_jobentry_type, copy.getNr(), copy.getLocation().x,
copy.getLocation().y, copy.isDrawn(), copy.isLaunchingInParallel()));
} catch (KettleDatabaseException dbe) {
throw new KettleException("Unable to save job entry copy to the repository, id_job=" + id_job, dbe);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:46,代码来源:KettleDatabaseRepositoryJobEntryDelegate.java
示例15: openTransformation
import org.pentaho.di.job.entry.JobEntryCopy; //导入方法依赖的package包/类
public void openTransformation() {
JobEntryCopy jobEntryCopy = getJobEntry();
final JobEntryInterface entry = jobEntryCopy.getEntry();
openTransformation((JobEntryTrans) entry, jobEntryCopy);
}