当前位置: 首页>>代码示例>>Java>>正文


Java Pre21JobHistoryConstants类代码示例

本文整理汇总了Java中org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants的典型用法代码示例。如果您正苦于以下问题:Java Pre21JobHistoryConstants类的具体用法?Java Pre21JobHistoryConstants怎么用?Java Pre21JobHistoryConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Pre21JobHistoryConstants类属于org.apache.hadoop.tools.rumen包,在下文中一共展示了Pre21JobHistoryConstants类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNextJobFiltered

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
/**
 * Filter some jobs being fed to the simulator. For now, we filter out killed
 * jobs to facilitate debugging.
 * 
 * @throws IOException
 */
private JobStory getNextJobFiltered() throws IOException {
  while (true) {
    ZombieJob job = producer.getNextJob();
    if (job == null) {
      return null;
    }
    if (job.getOutcome() == Pre21JobHistoryConstants.Values.KILLED) {
      continue;
    }
    if (job.getNumberMaps() == 0) {
      continue;
    }
    if (job.getNumLoggedMaps() == 0) {
      continue;
    }
    return job;
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:25,代码来源:SimulatorJobStoryProducer.java

示例2: buildDistCacheFilesList

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
/**
 * Create the list of unique distributed cache files needed for all the
 * simulated jobs and write the list to a special file.
 * @param jsp job story producer for the trace
 * @return exit code
 * @throws IOException
 */
private int buildDistCacheFilesList(JobStoryProducer jsp) throws IOException {
  // Read all the jobs from the trace file and build the list of unique
  // distributed cache files.
  JobStory jobStory;
  while ((jobStory = jsp.getNextJob()) != null) {
    if (jobStory.getOutcome() == Pre21JobHistoryConstants.Values.SUCCESS && 
       jobStory.getSubmissionTime() >= 0) {
      updateHDFSDistCacheFilesList(jobStory);
    }
  }
  jsp.close();

  return writeDistCacheFilesList();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:DistributedCacheEmulator.java

示例3: getNextJobFiltered

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
protected JobStory getNextJobFiltered() throws IOException {
 JobStory job;
 do {
   job = jobProducer.getNextJob();
 } while (job != null
     && (job.getOutcome() != Pre21JobHistoryConstants.Values.SUCCESS ||
         job.getSubmissionTime() < 0));
 return null == job ? null : new FilterJobStory(job) {
     @Override
     public TaskInfo getTaskInfo(TaskType taskType, int taskNumber) {
       return new MinTaskInfo(this.job.getTaskInfo(taskType, taskNumber));
      }
   };
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:15,代码来源:JobFactory.java

示例4: convertState

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
private Pre21JobHistoryConstants.Values convertState (JobStatus status) {
  int runState = status.getRunState();
  if (runState == JobStatus.FAILED) {
    return Pre21JobHistoryConstants.Values.FAILED;
  } else if (runState == JobStatus.SUCCEEDED) {
    return Pre21JobHistoryConstants.Values.SUCCESS;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:11,代码来源:MockSimulatorEngine.java

示例5: validateJobComplete

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
private void validateJobComplete(JobCompleteEvent completeEvent) {
  JobID jobId = completeEvent.getJobStatus().getJobID();
  JobStatus finalStatus = completeEvent.getJobStatus();

  Assert.assertTrue("Job completed was not submitted:"+jobId, 
             submittedJobs.contains(jobId));
  Assert.assertFalse("Job completed more than once:" + jobId, 
              completedJobs.contains(jobId));
  completedJobs.add(jobId);
 
  Pre21JobHistoryConstants.Values finalValue = jobs.get(jobId).getOutcome();
  Pre21JobHistoryConstants.Values obtainedStatus = convertState(finalStatus);
  Assert.assertEquals("Job completion final status mismatch", obtainedStatus,
      finalValue);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:16,代码来源:MockSimulatorEngine.java

示例6: validateJobSubmission

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
private void validateJobSubmission(JobSubmissionEvent submissionEvent) {
  JobID jobId = submissionEvent.getJob().getJobID();
  LOG.info("Job being submitted: " + jobId);
  Assert.assertFalse("Job " + jobId + " is already submitted", submittedJobs
      .contains(jobId));
  LOG.info("Adding to submitted Jobs " + jobId);
  submittedJobs.add(jobId); 
  jobs.put(jobId, submissionEvent.getJob());
  Pre21JobHistoryConstants.Values finalValue = submissionEvent.getJob().getOutcome();
  Assert.assertTrue("Job has final state neither SUCCESS nor FAILED",
      finalValue == Pre21JobHistoryConstants.Values.FAILED
          || finalValue == Pre21JobHistoryConstants.Values.SUCCESS);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:MockSimulatorEngine.java

示例7: getNextJobFiltered

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
private JobStory getNextJobFiltered() throws IOException {
  JobStory job;
  do {
    job = jobProducer.getNextJob();
  } while (job != null
      && (job.getOutcome() != Pre21JobHistoryConstants.Values.SUCCESS ||
          job.getSubmissionTime() < 0));
  return null == job ? null : new FilterJobStory(job) {
      @Override
      public TaskInfo getTaskInfo(TaskType taskType, int taskNumber) {
        return new MinTaskInfo(this.job.getTaskInfo(taskType, taskNumber));
      }
    };
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:15,代码来源:JobFactory.java

示例8: getNextJobFiltered

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
protected JobStory getNextJobFiltered() throws IOException {
  JobStory job;
  do {
    job = jobProducer.getNextJob();
  } while (job != null &&
    (job.getOutcome() != Pre21JobHistoryConstants.Values.SUCCESS ||
      job.getSubmissionTime() < 0));
  return null == job ? null : new FilterJobStory(job) {
    @Override
    public TaskInfo getTaskInfo(TaskType taskType, int taskNumber) {
      return new MinTaskInfo(this.job.getTaskInfo(taskType, taskNumber));
    }
  };
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:15,代码来源:JobFactory.java

示例9: getNextJobFiltered

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
protected JobStory getNextJobFiltered() throws IOException {
  JobStory job = getNextJobFromTrace();
  // filter out the following jobs
  //    - unsuccessful jobs
  //    - jobs with missing submit-time
  //    - reduce only jobs
  // These jobs are not yet supported in Gridmix
  while (job != null &&
    (job.getOutcome() != Pre21JobHistoryConstants.Values.SUCCESS ||
      job.getSubmissionTime() < 0 || job.getNumberMaps() == 0)) {
    if (LOG.isDebugEnabled()) {
      List<String> reason = new ArrayList<String>();
      if (job.getOutcome() != Pre21JobHistoryConstants.Values.SUCCESS) {
        reason.add("STATE (" + job.getOutcome().name() + ")");
      }
      if (job.getSubmissionTime() < 0) {
        reason.add("SUBMISSION-TIME (" + job.getSubmissionTime() + ")");
      }
      if (job.getNumberMaps() == 0) {
        reason.add("ZERO-MAPS-JOB");
      }
      
      // TODO This should never happen. Probably we missed something!
      if (reason.size() == 0) {
        reason.add("N/A");
      }
      
      LOG.debug("Ignoring job " + job.getJobID() + " from the input trace."
                + " Reason: " + StringUtils.join(reason, ","));
    }
    job = getNextJobFromTrace();
  }
  return null == job ? null : new FilterJobStory(job) {
    @Override
    public TaskInfo getTaskInfo(TaskType taskType, int taskNumber) {
      TaskInfo info = this.job.getTaskInfo(taskType, taskNumber);
      if (info != null) {
        info = new MinTaskInfo(info);
      } else {
        info = new MinTaskInfo(new TaskInfo(0, 0, 0, 0, 0));
      }
      return info;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:46,代码来源:JobFactory.java

示例10: getOutcome

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
@Override
public Pre21JobHistoryConstants.Values getOutcome() {
  return job.getOutcome();
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:SimulatorJobStory.java

示例11: getOutcome

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants; //导入依赖的package包/类
@Override
public Pre21JobHistoryConstants.Values getOutcome() {
  return Pre21JobHistoryConstants.Values.SUCCESS;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:TestSimulatorJobClient.java


注:本文中的org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。