private void updateMapRedStatsJson(MapRedStats stats, RunningJob rj) throws IOException, JSONException { if (statsJSON == null) { statsJSON = new JSONObject(); } if (stats != null) { if (stats.getNumMap() >= 0) { statsJSON.put(NUMBER_OF_MAPPERS, stats.getNumMap()); } if (stats.getNumReduce() >= 0) { statsJSON.put(NUMBER_OF_REDUCERS, stats.getNumReduce()); } if (stats.getCounters() != null) { statsJSON.put(COUNTERS, getCountersJson(stats.getCounters())); } } if (rj != null) { statsJSON.put(JOB_ID, rj.getID().toString()); statsJSON.put(JOB_FILE, rj.getJobFile()); statsJSON.put(TRACKING_URL, rj.getTrackingURL()); statsJSON.put(MAP_PROGRESS, Math.round(rj.mapProgress() * 100)); statsJSON.put(REDUCE_PROGRESS, Math.round(rj.reduceProgress() * 100)); statsJSON.put(CLEANUP_PROGRESS, Math.round(rj.cleanupProgress() * 100)); statsJSON.put(SETUP_PROGRESS, Math.round(rj.setupProgress() * 100)); statsJSON.put(COMPLETE, rj.isComplete()); statsJSON.put(SUCCESSFUL, rj.isSuccessful()); } }
@Override public float setupProgress() throws IOException { return delegate.setupProgress(); }
/** * Get the <i>progress</i> of the job's setup, as a float between 0.0 * and 1.0. When the job setup is completed, the function returns 1.0. * * @return the progress of the job's setup. * @throws IOException */ public float setupProgress() throws IOException { ensureState(JobState.RUNNING); return info.setupProgress(); }
assertTrue("Setup progress is " + runningJob.setupProgress() + " and not 1.0", runningJob.setupProgress() == 1.0); assertTrue("Setup task is not finished!", mr.getJobTrackerRunner() .getJobTracker().getJob(jobID).isSetupFinished());