Package com.twitter.ambrose.model.hadoop

Examples of com.twitter.ambrose.model.hadoop.MapReduceJobState


    reporter.pushEvent(queryId, new Event.WorkflowProgressEvent(eventData));
  }
 
  private boolean updateJobState() throws IOException {
    if (jobProgress == null) {
      jobProgress = new MapReduceJobState(
          rj, jobClient.getMapTaskReports(jobId), jobClient.getReduceTaskReports(jobId));
      return true;
    }
   
    boolean complete = rj.isComplete();
    boolean successful = rj.isSuccessful();
    float mapProgress = rj.mapProgress();
    float reduceProgress = rj.reduceProgress();

    boolean update = !(
        jobProgress.isComplete() == complete &&
        jobProgress.isSuccessful() == successful &&
        AmbroseHiveUtil.isEqual(jobProgress.getMapProgress(), mapProgress) &&
        AmbroseHiveUtil.isEqual(jobProgress.getReduceProgress(), reduceProgress)
    );
   
    //do progress report only if necessary
    if (update) {
      jobProgress = new MapReduceJobState(
          rj, jobClient.getMapTaskReports(jobId), jobClient.getReduceTaskReports(jobId));
      jobProgress.setJobLastUpdateTime(System.currentTimeMillis());
    }
    return update;
  }
View Full Code Here


        String nodeId = AmbroseHiveUtil.getNodeIdFromNodeName(conf, task.getId());
        DAGNode<Job> dagNode = reporter.getDAGNodeFromNodeId(nodeId);
       
        HiveJob job = (HiveJob) dagNode.getJob();
        job.setConfiguration(allConfProps);
        MapReduceJobState mrJobState = getJobState(job);
        mrJobState.setSuccessful(false);
        reporter.addJob((Job) job);
        reporter.pushEvent(queryId, new Event.JobFailedEvent(dagNode));
      }
    }
View Full Code Here

    }
    return field;
  }

  private MapReduceJobState getJobState(HiveJob job) {
    MapReduceJobState jobState = job.getMapReduceJobState();
    if (jobState != null) {
      return jobState;
    }
    // if job fails immediately after its submission
    jobState = new MapReduceJobState();
    jobState.setJobId(job.getId());
    return jobState;
  }
View Full Code Here

TOP

Related Classes of com.twitter.ambrose.model.hadoop.MapReduceJobState

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.