/** Return the current values of the counters for this job, * including tasks that are in progress. */ public synchronized Counters getCurrentCounters() { if (null == mapCounters) { // Counters not yet initialized for job. return EMPTY_COUNTERS; } Counters current = EMPTY_COUNTERS; for (Counters c : mapCounters) { current = Counters.sum(current, c); } current = Counters.sum(current, reduceCounters); return current; }
/** Return the current values of the counters for this job, * including tasks that are in progress. */ public synchronized Counters getCurrentCounters() { if (null == mapCounters) { // Counters not yet initialized for job. return new Counters(); } Counters current = new Counters(); for (Counters c : mapCounters) { current = Counters.sum(current, c); } if (null != reduceCounters && reduceCounters.length > 0) { for (Counters c : reduceCounters) { current = Counters.sum(current, c); } } return current; }
/** Return the current values of the counters for this job, * including tasks that are in progress. */ public synchronized Counters getCurrentCounters() { if (null == mapCounters) { // Counters not yet initialized for job. return new Counters(); } Counters current = new Counters(); for (Counters c : mapCounters) { current = Counters.sum(current, c); } if (null != reduceCounters && reduceCounters.length > 0) { for (Counters c : reduceCounters) { current = Counters.sum(current, c); } } return current; }
/** Return the current values of the counters for this job, * including tasks that are in progress. */ public synchronized Counters getCurrentCounters() { if (null == mapCounters) { // Counters not yet initialized for job. return new Counters(); } Counters current = new Counters(); for (Counters c : mapCounters) { current = Counters.sum(current, c); } if (null != reduceCounters && reduceCounters.length > 0) { for (Counters c : reduceCounters) { current = Counters.sum(current, c); } } return current; }
/** Return the current values of the counters for this job, * including tasks that are in progress. */ public synchronized Counters getCurrentCounters() { if (null == mapCounters) { // Counters not yet initialized for job. return new Counters(); } Counters current = new Counters(); for (Counters c : mapCounters) { current = Counters.sum(current, c); } if (null != reduceCounters && reduceCounters.length > 0) { for (Counters c : reduceCounters) { current = Counters.sum(current, c); } } return current; }
public boolean statusUpdate(TaskAttemptID taskId, TaskStatus taskStatus) throws IOException, InterruptedException { LOG.info(taskStatus.getStateString()); float taskIndex = mapIds.indexOf(taskId); if (taskIndex >= 0) { // mapping float numTasks = mapIds.size(); status.setMapProgress(taskIndex/numTasks + taskStatus.getProgress()/numTasks); } else { status.setReduceProgress(taskStatus.getProgress()); } currentCounters = Counters.sum(completedTaskCounters, taskStatus.getCounters()); // ignore phase return true; }