* @return the newly created P2jJobStatus
*/
@SuppressWarnings("deprecation")
protected P2jJobStatus buildJobStatusMap(String jobId) {
JobClient jobClient = PigStats.get().getJobClient();
P2jJobStatus js = jobIdToJobStatusMap.get(jobId);
try {
RunningJob rj = jobClient.getJob(jobId);
if (rj == null) {
LOG.warn("Couldn't find job status for jobId=" + jobId);
return js;
}
JobID jobID = rj.getID();
Counters counters = rj.getCounters();
js.setCounters(buildCountersMap(counters));
js.setWarnings(getRunningJobWarnings(jobClient, jobID));
js.setJobName(rj.getJobName());
js.setTrackingUrl(rj.getTrackingURL());
js.setIsComplete(rj.isComplete());
js.setIsSuccessful(rj.isSuccessful());
js.setMapProgress(rj.mapProgress());
js.setReduceProgress(rj.reduceProgress());
js.setTotalMappers((int)counters.findCounter(JobInProgress.Counter.TOTAL_LAUNCHED_MAPS).getCounter());
js.setTotalReducers((int)counters.findCounter(JobInProgress.Counter.TOTAL_LAUNCHED_REDUCES).getCounter());
return js;
} catch (IOException e) {
LOG.error("Error getting job info.", e);
}