Example #1
0
 /** Get the events list at the tasktracker */
 public MapTaskCompletionEventsUpdate getMapTaskCompletionEventsUpdates(
     int index, JobID jobId, int max) throws IOException {
   String jtId = jobTracker.getJobTracker().getTrackerIdentifier();
   TaskAttemptID dummy = new TaskAttemptID(jtId, jobId.getId(), false, 0, 0);
   return taskTrackerList
       .get(index)
       .getTaskTracker()
       .getMapCompletionEvents(jobId, 0, max, dummy, null);
 }
Example #2
0
  /** Kill the jobtracker. */
  public void stopJobTracker() {
    // jobTracker.exit(-1);
    jobTracker.shutdown();

    jobTrackerThread.interrupt();
    try {
      jobTrackerThread.join();
    } catch (InterruptedException ex) {
      LOG.error("Problem waiting for job tracker to finish", ex);
    }
  }
Example #3
0
  void startJobTracker(boolean wait) {
    //  Create the JobTracker
    jobTracker = new JobTrackerRunner(conf);
    jobTrackerThread = new Thread(jobTracker);

    jobTrackerThread.start();

    if (!wait) {
      return;
    }

    while (jobTracker.isActive() && !jobTracker.isUp()) {
      try { // let daemons get started
        Thread.sleep(1000);
      } catch (InterruptedException e) {
      }
    }

    // is the jobtracker has started then wait for it to init
    ClusterStatus status = null;
    if (jobTracker.isUp()) {
      status = jobTracker.getJobTracker().getClusterStatus(false);
      while (jobTracker.isActive()
          && status.getJobTrackerState() == JobTracker.State.INITIALIZING) {
        try {
          LOG.info("JobTracker still initializing. Waiting.");
          Thread.sleep(1000);
        } catch (InterruptedException e) {
        }
        status = jobTracker.getJobTracker().getClusterStatus(false);
      }
    }

    if (!jobTracker.isActive()) {
      // return if jobtracker has crashed
      return;
    }

    // Set the configuration for the task-trackers
    this.jobTrackerPort = jobTracker.getJobTrackerPort();
    this.jobTrackerInfoPort = jobTracker.getJobTrackerInfoPort();
  }
Example #4
0
 public int getFaultCount(String hostName) {
   return jobTracker.getJobTracker().getFaultCount(hostName);
 }
Example #5
0
 /** Get num events recovered */
 public int getNumEventsRecovered() {
   return jobTracker.getJobTracker().recoveryManager.totalEventsRecovered();
 }
Example #6
0
 /** Init the job */
 public void initializeJob(JobID jobId) throws IOException {
   JobInProgress job = jobTracker.getJobTracker().getJob(jobId);
   jobTracker.getJobTracker().initJob(job);
 }
Example #7
0
 /** Get the job finish time */
 public long getJobFinishTime(JobID jobId) {
   return jobTracker.getJobTracker().getJob(jobId).getFinishTime();
 }
Example #8
0
 /** Get the job's priority */
 public JobPriority getJobPriority(JobID jobId) {
   return jobTracker.getJobTracker().getJob(jobId).getPriority();
 }
Example #9
0
 /**
  * Change the job's priority
  *
  * @throws IOException
  * @throws AccessControlException
  */
 public void setJobPriority(JobID jobId, JobPriority priority)
     throws AccessControlException, IOException {
   jobTracker.getJobTracker().setJobPriority(jobId, priority);
 }
Example #10
0
 /** Get the task completion events */
 public TaskCompletionEvent[] getTaskCompletionEvents(JobID id, int from, int max)
     throws IOException {
   return jobTracker.getJobTracker().getTaskCompletionEvents(id, from, max);
 }