Examples of JobHistory


Examples of com.taobao.zeus.model.JobHistory

      if(mvce.getAppEvent() instanceof JobSuccessEvent){
        final JobSuccessEvent event=(JobSuccessEvent) mvce.getAppEvent();
        if(event.getTriggerType()==TriggerType.SCHEDULE){
          return;
        }
        JobHistory history=jobHistoryManager.findJobHistory(event.getHistoryId());
        final JobDescriptor jd=groupManager.getJobDescriptor(history.getJobId()).getX();
        if(history.getOperator()!=null){
          //此处可以发送IM消息
        }
      }
    } catch (Exception e) {
      //处理异常,防止后续的依赖任务受此影响,无法正常执行
View Full Code Here

Examples of com.taobao.zeus.model.JobHistory

  }
 
  public Future<Response> cancelManual(final WorkerContext context,final Request req,final String historyId){
    // 查找该job是否在运行中,如果不在,响应ERROR
    // 如果在,执行取消操作,等待操作结束后,响应OK
    JobHistory history=context.getJobHistoryManager().findJobHistory(historyId);
    final String jobId=history.getJobId();
    SocketLog.info("receive master cancel request,rid="+req.getRid()+",jobId="+jobId);
    if(!context.getManualRunnings().containsKey(historyId)){
      return context.getThreadPool().submit(new Callable<Response>() {
        public Response call() throws Exception {
          return Response.newBuilder().setRid(req.getRid()).setOperate(Operate.Cancel).setStatus(Status.ERROR)
View Full Code Here

Examples of com.taobao.zeus.model.JobHistory

  }
 
  public Future<Response> cancelSchedule(final WorkerContext context,final Request req,final String historyId){
    // 查找该job是否在运行中,如果不在,响应ERROR
    // 如果在,执行取消操作,等待操作结束后,响应OK
    JobHistory history=context.getJobHistoryManager().findJobHistory(historyId);
    final String jobId=history.getJobId();
    SocketLog.info("receive master cancel request,rid="+req.getRid()+",jobId="+jobId);
    if(!context.getRunnings().containsKey(jobId)){
      return context.getThreadPool().submit(new Callable<Response>() {
        public Response call() throws Exception {
          return Response.newBuilder().setRid(req.getRid()).setOperate(Operate.Cancel).setStatus(Status.ERROR)
View Full Code Here

Examples of com.taobao.zeus.model.JobHistory

    } catch (InvalidProtocolBufferException e1) {
    }
    SocketLog.info("receive master to worker manual request,rid="
        + req.getRid() + ",historyId=" + mm.getHistoryId());
    final String historyId = mm.getHistoryId();
    final JobHistory history = context.getJobHistoryManager()
        .findJobHistory(historyId);
    Future<Response> f = context.getThreadPool().submit(
        new Callable<Response>() {
          public Response call() throws Exception {
            history.setExecuteHost(WorkerContext.host);
            history.setStartTime(new Date());
            context.getJobHistoryManager()
                .updateJobHistory(history);

            String date = new SimpleDateFormat("yyyy-MM-dd")
                .format(new Date());
            File direcotry = new File(Environment.getDownloadPath()
                + File.separator + date + File.separator
                + "manual-" + history.getId());
            if (!direcotry.exists()) {
              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
                  .getJobHistoryManager()
                  .findJobHistory(history.getId());
              jobHistory.setEndTime(new Date());
              if (exitCode == 0) {
                jobHistory
                    .setStatus(com.taobao.zeus.model.JobStatus.Status.SUCCESS);
              } else {
                jobHistory
                    .setStatus(com.taobao.zeus.model.JobStatus.Status.FAILED);
              }
              context.getJobHistoryManager().updateJobHistory(
                  jobHistory);
              history.getLog().appendZeus("exitCode=" + exitCode);
View Full Code Here

Examples of com.taobao.zeus.model.JobHistory

                  Status.ERROR).build();
        }
      });
    }
    final JobStatus js = context.getGroupManager().getJobStatus(jobId);
    final JobHistory history = context.getJobHistoryManager()
        .findJobHistory(js.getHistoryId());
    Future<Response> f = context.getThreadPool().submit(
        new Callable<Response>() {
          public Response call() throws Exception {
            history.setExecuteHost(WorkerContext.host);
            history.setStartTime(new Date());
            context.getJobHistoryManager()
                .updateJobHistory(history);

            JobBean jb = context.getGroupManager()
                .getUpstreamJobBean(history.getJobId());
            String date = new SimpleDateFormat("yyyy-MM-dd")
                .format(new Date());
            File direcotry = new File(Environment.getDownloadPath()
                + File.separator + date + File.separator
                + 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
                  .getJobHistoryManager()
                  .findJobHistory(history.getId());
              jobHistory.setEndTime(new Date());
              if (exitCode == 0) {
                jobHistory
                    .setStatus(com.taobao.zeus.model.JobStatus.Status.SUCCESS);
              } else {
                jobHistory
                    .setStatus(com.taobao.zeus.model.JobStatus.Status.FAILED);
              }
              context.getJobHistoryManager().updateJobHistory(
                  jobHistory);
              history.getLog().appendZeus("exitCode=" + exitCode);
View Full Code Here

Examples of com.taobao.zeus.model.JobHistory

    JSONObject jsonData = new JSONObject();
    //JSONObject data = new JSONObject();
    jsonData.put("id", result.getId()+"-"+new Random().nextInt(1000));
    jsonData.put("name", result.getName());
    Map<String, JobHistory> map=jobHistoryManager.findLastHistoryByList(Arrays.asList(result.getId()));
    JobHistory his=map.get(result.getId());
    JSONObject data=new JSONObject();
    if(his==null){
      data.put("jobId",result.getId());
      data.put("historyId", "");
      data.put("lastStatus", "");
      data.put("lastRuntime", 0);
    }else{
      data.put("jobId",result.getId());
      data.put("historyId", his.getId());
      data.put("lastStatus", his.getStatus()==null?"":his.getStatus().toString());
      data.put("lastRuntime", his.getStartTime()==null?null:his.getStartTime().getTime());
    }
    jsonData.put("data", data);
    if(result.getChildren().size()>0)
      jsonData.put("children", getChildren(result));
    else
View Full Code Here

Examples of org.apache.hadoop.mapreduce.jobhistory.JobHistory

    this.startTime = clock.getTime();
    infoServer = new HttpServer("job", infoBindAddress, tmpInfoPort,
        tmpInfoPort == 0, conf, aclsManager.getAdminsAcl());
    infoServer.setAttribute("job.tracker", this);
    // initialize history parameters.
    jobHistory = new JobHistory();
    jobHistory.init(this, conf, this.localMachine, this.startTime);
   
    infoServer.addServlet("reducegraph", "/taskgraph", TaskGraphServlet.class);
    infoServer.start();
   
View Full Code Here

Examples of org.apache.hadoop.mapreduce.jobhistory.JobHistory

    infoServer.setAttribute("job.tracker", this);
   
    // initialize history parameters.
    FileSystem historyFS = null;

    jobHistory = new JobHistory();
    final JobTracker jtFinal = this;
    try {
      historyFS = getMROwner().doAs(new PrivilegedExceptionAction<FileSystem>() {
        public FileSystem run() throws IOException {
          jobHistory.init(jtFinal, conf, jtFinal.localMachine, jtFinal.startTime);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.jobhistory.JobHistory

   */
  public static void validateJobHistoryFileContent(MiniMRCluster mr,
                              RunningJob job, JobConf conf) throws IOException  {

    JobID id = job.getID();
    JobHistory jobHistory =
      mr.getJobTrackerRunner().getJobTracker().getJobHistory();
    Path doneDir = jobHistory.getCompletedJobHistoryLocation();
    // Get the history file name
    String logFileName = getDoneFile(jobHistory, conf, id, doneDir);

    // Framework history log file location
    Path logFile = new Path(doneDir, logFileName);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.jobhistory.JobHistory

          3, null, null, conf);

      assertEquals("Files in logDir did not move to DONE folder",
          0, logDirFs.listStatus(logDirPath).length);

      JobHistory jobHistory =
        mr.getJobTrackerRunner().getJobTracker().getJobHistory();
      Path doneDir = jobHistory.getCompletedJobHistoryLocation();

      assertEquals("Files in DONE dir not correct",
          2, doneDir.getFileSystem(conf).listStatus(doneDir).length);

      // run the TCs
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.