Java Code Examples for org.apache.hadoop.mapred.JobConf#DEFAULT_QUEUE_NAME

The following examples show how to use org.apache.hadoop.mapred.JobConf#DEFAULT_QUEUE_NAME . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZombieJob.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public String getQueueName() {
  QueueName queue = job.getQueue();
  return (queue == null || queue.getValue() == null) 
         ? JobConf.DEFAULT_QUEUE_NAME 
         : queue.getValue();
}
 
Example 2
Source File: ZombieJob.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public String getQueueName() {
  QueueName queue = job.getQueue();
  return (queue == null || queue.getValue() == null) 
         ? JobConf.DEFAULT_QUEUE_NAME 
         : queue.getValue();
}
 
Example 3
Source File: JobHistoryEventHandler.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * Create an event writer for the Job represented by the jobID.
 * Writes out the job configuration to the log directory.
 * This should be the first call to history for a job
 * 
 * @param jobId the jobId.
 * @param amStartedEvent
 * @throws IOException
 */
protected void setupEventWriter(JobId jobId, AMStartedEvent amStartedEvent)
    throws IOException {
  if (stagingDirPath == null) {
    LOG.error("Log Directory is null, returning");
    throw new IOException("Missing Log Directory for History");
  }

  MetaInfo oldFi = fileMap.get(jobId);
  Configuration conf = getConfig();

  // TODO Ideally this should be written out to the job dir
  // (.staging/jobid/files - RecoveryService will need to be patched)
  Path historyFile = JobHistoryUtils.getStagingJobHistoryFile(
      stagingDirPath, jobId, startCount);
  String user = UserGroupInformation.getCurrentUser().getShortUserName();
  if (user == null) {
    throw new IOException(
        "User is null while setting up jobhistory eventwriter");
  }

  String jobName = context.getJob(jobId).getName();
  EventWriter writer = (oldFi == null) ? null : oldFi.writer;
 
  Path logDirConfPath =
      JobHistoryUtils.getStagingConfFile(stagingDirPath, jobId, startCount);
  if (writer == null) {
    try {
      writer = createEventWriter(historyFile);
      LOG.info("Event Writer setup for JobId: " + jobId + ", File: "
          + historyFile);
    } catch (IOException ioe) {
      LOG.info("Could not create log file: [" + historyFile + "] + for job "
          + "[" + jobName + "]");
      throw ioe;
    }
    
    //Write out conf only if the writer isn't already setup.
    if (conf != null) {
      // TODO Ideally this should be written out to the job dir
      // (.staging/jobid/files - RecoveryService will need to be patched)
      FSDataOutputStream jobFileOut = null;
      try {
        if (logDirConfPath != null) {
          jobFileOut = stagingDirFS.create(logDirConfPath, true);
          conf.writeXml(jobFileOut);
          jobFileOut.close();
        }
      } catch (IOException e) {
        LOG.info("Failed to write the job configuration file", e);
        throw e;
      }
    }
  }

  String queueName = JobConf.DEFAULT_QUEUE_NAME;
  if (conf != null) {
    queueName = conf.get(MRJobConfig.QUEUE_NAME, JobConf.DEFAULT_QUEUE_NAME);
  }

  MetaInfo fi = new MetaInfo(historyFile, logDirConfPath, writer,
      user, jobName, jobId, amStartedEvent.getForcedJobStateOnShutDown(),
      queueName);
  fi.getJobSummary().setJobId(jobId);
  fi.getJobSummary().setJobLaunchTime(amStartedEvent.getStartTime());
  fi.getJobSummary().setJobSubmitTime(amStartedEvent.getSubmitTime());
  fi.getJobIndexInfo().setJobStartTime(amStartedEvent.getStartTime());
  fi.getJobIndexInfo().setSubmitTime(amStartedEvent.getSubmitTime());
  fileMap.put(jobId, fi);
}
 
Example 4
Source File: JobIndexInfo.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public JobIndexInfo(long submitTime, long finishTime, String user,
    String jobName, JobId jobId, int numMaps, int numReduces, String jobStatus) {
  this(submitTime, finishTime, user, jobName, jobId, numMaps, numReduces,
       jobStatus, JobConf.DEFAULT_QUEUE_NAME);
}
 
Example 5
Source File: JobHistoryEventHandler.java    From big-c with Apache License 2.0 4 votes vote down vote up
/**
 * Create an event writer for the Job represented by the jobID.
 * Writes out the job configuration to the log directory.
 * This should be the first call to history for a job
 * 
 * @param jobId the jobId.
 * @param amStartedEvent
 * @throws IOException
 */
protected void setupEventWriter(JobId jobId, AMStartedEvent amStartedEvent)
    throws IOException {
  if (stagingDirPath == null) {
    LOG.error("Log Directory is null, returning");
    throw new IOException("Missing Log Directory for History");
  }

  MetaInfo oldFi = fileMap.get(jobId);
  Configuration conf = getConfig();

  // TODO Ideally this should be written out to the job dir
  // (.staging/jobid/files - RecoveryService will need to be patched)
  Path historyFile = JobHistoryUtils.getStagingJobHistoryFile(
      stagingDirPath, jobId, startCount);
  String user = UserGroupInformation.getCurrentUser().getShortUserName();
  if (user == null) {
    throw new IOException(
        "User is null while setting up jobhistory eventwriter");
  }

  String jobName = context.getJob(jobId).getName();
  EventWriter writer = (oldFi == null) ? null : oldFi.writer;
 
  Path logDirConfPath =
      JobHistoryUtils.getStagingConfFile(stagingDirPath, jobId, startCount);
  if (writer == null) {
    try {
      writer = createEventWriter(historyFile);
      LOG.info("Event Writer setup for JobId: " + jobId + ", File: "
          + historyFile);
    } catch (IOException ioe) {
      LOG.info("Could not create log file: [" + historyFile + "] + for job "
          + "[" + jobName + "]");
      throw ioe;
    }
    
    //Write out conf only if the writer isn't already setup.
    if (conf != null) {
      // TODO Ideally this should be written out to the job dir
      // (.staging/jobid/files - RecoveryService will need to be patched)
      FSDataOutputStream jobFileOut = null;
      try {
        if (logDirConfPath != null) {
          jobFileOut = stagingDirFS.create(logDirConfPath, true);
          conf.writeXml(jobFileOut);
          jobFileOut.close();
        }
      } catch (IOException e) {
        LOG.info("Failed to write the job configuration file", e);
        throw e;
      }
    }
  }

  String queueName = JobConf.DEFAULT_QUEUE_NAME;
  if (conf != null) {
    queueName = conf.get(MRJobConfig.QUEUE_NAME, JobConf.DEFAULT_QUEUE_NAME);
  }

  MetaInfo fi = new MetaInfo(historyFile, logDirConfPath, writer,
      user, jobName, jobId, amStartedEvent.getForcedJobStateOnShutDown(),
      queueName);
  fi.getJobSummary().setJobId(jobId);
  fi.getJobSummary().setJobLaunchTime(amStartedEvent.getStartTime());
  fi.getJobSummary().setJobSubmitTime(amStartedEvent.getSubmitTime());
  fi.getJobIndexInfo().setJobStartTime(amStartedEvent.getStartTime());
  fi.getJobIndexInfo().setSubmitTime(amStartedEvent.getSubmitTime());
  fileMap.put(jobId, fi);
}
 
Example 6
Source File: JobIndexInfo.java    From big-c with Apache License 2.0 4 votes vote down vote up
public JobIndexInfo(long submitTime, long finishTime, String user,
    String jobName, JobId jobId, int numMaps, int numReduces, String jobStatus) {
  this(submitTime, finishTime, user, jobName, jobId, numMaps, numReduces,
       jobStatus, JobConf.DEFAULT_QUEUE_NAME);
}