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


Java JobStatus.RUNNING属性代码示例

本文整理汇总了Java中org.apache.hadoop.mapred.JobStatus.RUNNING属性的典型用法代码示例。如果您正苦于以下问题:Java JobStatus.RUNNING属性的具体用法?Java JobStatus.RUNNING怎么用?Java JobStatus.RUNNING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.mapred.JobStatus的用法示例。


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

示例1: isJobStarted

/**
 * It uses to check whether job is started or not.
 * @param id job id
 * @return true if job is running.
 * @throws IOException if an I/O error occurs.
 */
public boolean isJobStarted(JobID id) throws IOException {
  JobInfo jInfo = getJobInfo(id);
  int counter = 0;
  while (counter < 60) {
    if (jInfo.getStatus().getRunState() == JobStatus.RUNNING) {
      break;
    } else {
      UtilsForTests.waitFor(1000);
      jInfo = getJobInfo(jInfo.getID());
      Assert.assertNotNull("Job information is null",jInfo);
    }
    counter++;
  }
  return (counter != 60)? true : false ;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:JTClient.java

示例2: convertMapreduceState

/**
 * Convert map-reduce specific job status constants to Sqoop job status
 * constants.
 *
 * @param status Map-reduce job constant
 * @return Equivalent submission status
 */
private SubmissionStatus convertMapreduceState(int status) {
  if(status == JobStatus.PREP) {
    return SubmissionStatus.BOOTING;
  } else if (status == JobStatus.RUNNING) {
    return SubmissionStatus.RUNNING;
  } else if (status == JobStatus.FAILED) {
    return SubmissionStatus.FAILED;
  } else if (status == JobStatus.KILLED) {
    return SubmissionStatus.FAILED;
  } else if (status == JobStatus.SUCCEEDED) {
    return SubmissionStatus.SUCCEEDED;
  }

  throw new SqoopException(MapreduceSubmissionError.MAPREDUCE_0004,
    "Unknown status " + status);
}
 
开发者ID:vybs,项目名称:sqoop-on-spark,代码行数:23,代码来源:MapreduceSubmissionEngine.java

示例3: ofInt

static JobState ofInt(int state) {
  if (state == JobStatus.PREP) {
    return PREPARE;
  }
  else if (state == JobStatus.RUNNING) {
    return RUNNING;
  }
  else if (state == JobStatus.FAILED) {
    return FAILED;
  }
  else if (state == JobStatus.SUCCEEDED) {
    return SUCCEEDED;
  }
  else {
    return null;
  }
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:17,代码来源:HadoopJob.java

示例4: ofInt

static JobState ofInt(int state) {
  switch (state) {
    case JobStatus.PREP:
      return PREPARE;
    case JobStatus.RUNNING:
      return RUNNING;
    case JobStatus.FAILED:
      return FAILED;
    case JobStatus.SUCCEEDED:
      return SUCCEEDED;
    default:
      return null;
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:14,代码来源:HadoopJob.java

示例5: updateRunnability

private void updateRunnability() {
  // Start by marking everything as not runnable
  for (JobInfo info: infos.values()) {
    info.runnable = false;
  }
  // Create a list of sorted jobs in order of start time and priority
  List<JobInProgress> jobs = new ArrayList<JobInProgress>(infos.keySet());
  Collections.sort(jobs, new FifoJobComparator());
  // Mark jobs as runnable in order of start time and priority, until
  // user or pool limits have been reached.
  Map<String, Integer> userJobs = new HashMap<String, Integer>();
  Map<String, Integer> poolJobs = new HashMap<String, Integer>();
  for (JobInProgress job: jobs) {
    if (job.getStatus().getRunState() == JobStatus.RUNNING) {
      String user = job.getJobConf().getUser();
      String pool = poolMgr.getPoolName(job);
      int userCount = userJobs.containsKey(user) ? userJobs.get(user) : 0;
      int poolCount = poolJobs.containsKey(pool) ? poolJobs.get(pool) : 0;
      if (userCount < poolMgr.getUserMaxJobs(user) && 
          poolCount < poolMgr.getPoolMaxJobs(pool)) {
        infos.get(job).runnable = true;
        userJobs.put(user, userCount + 1);
        poolJobs.put(pool, poolCount + 1);
      }
    }
  }
}
 
开发者ID:thisisvoa,项目名称:hadoop-0.20,代码行数:27,代码来源:FairScheduler.java


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