本文整理汇总了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 ;
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
}
}