Package com.taobao.zeus.jobs

Examples of com.taobao.zeus.jobs.Job


    }
    jobContext.setProperties(new RenderHierarchyProperties(hp));
    hp.setProperty("hadoop.mapred.job.zeus_id", "zeus_debug_"+history.getId());
    List<Job> pres = new ArrayList<Job>(1);
    pres.add(new DownloadJob(jobContext));
    Job core = null;
    if(history.getJobRunType()==JobRunType.Hive){
      core =new HiveJob(jobContext,applicationContext);
    }else if(history.getJobRunType()==JobRunType.Shell){
      core=new HadoopShellJob(jobContext);
    }
    Job job=new WithProcesserJob(jobContext, pres, new ArrayList<Job>(), core, applicationContext);
    return job;
  }
View Full Code Here


    pres.add(0, new DownloadJob(jobContext));
    //后置处理Job创建
    List<Job> posts=parseJobs( jobContext, applicationContext, jobBean,jobBean.getJobDescriptor().getPostProcessers(),history,workDir);
    posts.add(new ZooKeeperJob(jobContext, null, applicationContext));
    //核心处理Job创建
    Job core=null;
    if(jobBean.getJobDescriptor().getJobType()==JobRunType.MapReduce){
      core=new MapReduceJob(jobContext);
    }else if(jobBean.getJobDescriptor().getJobType()==JobRunType.Shell){
      core=new HadoopShellJob(jobContext);
    }else if(jobBean.getJobDescriptor().getJobType()==JobRunType.Hive){
      core=new HiveJob(jobContext,applicationContext);
    }
   
    Job job=new WithProcesserJob(jobContext, pres, posts, core,applicationContext);
   
    return job;
  }
View Full Code Here

            if(!direcotry.exists()){
              direcotry.mkdirs();
            }
            JobContext sub=new JobContext(jobContext.getRunType());
            sub.putData("depth", ++depth);
            Job job=createJob(sub,jb, history, direcotry.getAbsolutePath(), applicationContext);
            jobs.add(job);
          }
        }else{
          jobContext.getJobHistory().getLog().appendZeus("递归的JobProcesser处理单元深度过大,停止递归");
        }
View Full Code Here

    }
    ScheduleInfoLog.info("worker connect server success");
  }

  public void cancelDebugJob(String debugId) {
    Job job = context.getDebugRunnings().get(debugId);
    if (job == null) {
      throw new RuntimeException("任务已经不存在");
    }
    job.cancel();
    context.getDebugRunnings().remove(debugId);

    DebugHistory his = job.getJobContext().getDebugHistory();
    his.setEndTime(new Date());
    his.setStatus(com.taobao.zeus.model.JobStatus.Status.FAILED);
    context.getDebugHistoryManager().updateDebugHistory(his);
    his.getLog().appendZeus("任务被取消");
    context.getDebugHistoryManager().updateDebugHistoryLog(his.getId(),
View Full Code Here

    context.getDebugHistoryManager().updateDebugHistoryLog(his.getId(),
        his.getLog().getContent());
  }

  public void cancelManualJob(String historyId) {
    Job job = context.getManualRunnings().get(historyId);
    context.getManualRunnings().remove(historyId);
    job.cancel();

    JobHistory his = job.getJobContext().getJobHistory();
    his.setEndTime(new Date());
    his.setStatus(com.taobao.zeus.model.JobStatus.Status.FAILED);
    context.getJobHistoryManager().updateJobHistory(his);
    his.getLog().appendZeus("任务被取消");
    context.getJobHistoryManager().updateJobHistoryLog(his.getId(),
View Full Code Here

    context.getJobHistoryManager().updateJobHistoryLog(his.getId(),
        his.getLog().getContent());
  }

  public void cancelScheduleJob(String jobId) {
    Job job = context.getRunnings().get(jobId);
    context.getRunnings().remove(jobId);
    job.cancel();

    JobHistory his = job.getJobContext().getJobHistory();
    his.setEndTime(new Date());
    his.setStatus(com.taobao.zeus.model.JobStatus.Status.FAILED);
    context.getJobHistoryManager().updateJobHistory(his);
    his.getLog().appendZeus("任务被取消");
    context.getJobHistoryManager().updateJobHistoryLog(his.getId(),
View Full Code Here

              direcotry.mkdirs();
            }
            JobBean jb = context.getGroupManager()
                .getUpstreamJobBean(history.getJobId());

            final Job job = JobUtils.createJob(new JobContext(JobContext.MANUAL_RUN),
                jb, history, direcotry.getAbsolutePath(),
                context.getApplicationContext());
            context.getManualRunnings().put(historyId, job);

            Integer exitCode = -1;
            Exception exception = null;
            try {
              exitCode = job.run();
            } catch (Exception e) {
              exception = e;
              history.getLog().appendZeusException(e);
            } finally {
              JobHistory jobHistory = context
View Full Code Here

                + File.separator + date + File.separator
                + "debug-" + history.getId());
            if (!direcotry.exists()) {
              direcotry.mkdirs();
            }
            final Job job = JobUtils.createDebugJob(
                new JobContext(JobContext.DEBUG_RUN), history, direcotry
                    .getAbsolutePath(), context
                    .getApplicationContext());
            context.getDebugRunnings().put(debugId, job);

            Integer exitCode = -1;
            Exception exception = null;
            try {
              exitCode = job.run();
            } catch (Exception e) {
              exception = e;
              history.getLog().appendZeusException(e);
            } finally {
              DebugHistory debugHistory = context
View Full Code Here

                + history.getId());
            if (!direcotry.exists()) {
              direcotry.mkdirs();
            }

            final Job job = JobUtils.createJob(new JobContext(JobContext.SCHEDULE_RUN),
                jb, history, direcotry.getAbsolutePath(),
                context.getApplicationContext());
            context.getRunnings().put(jobId, job);

            Integer exitCode = -1;
            Exception exception = null;
            try {
              exitCode = job.run();
            } catch (Exception e) {
              exception = e;
              history.getLog().appendZeusException(e);
            } finally {
              JobHistory jobHistory = context
View Full Code Here

TOP

Related Classes of com.taobao.zeus.jobs.Job

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.