/** * Convenience method for computing the sum of two sets of counters. * @param a the first counters * @param b the second counters * @return a new summed counters object */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. * @param a the first counters * @param b the second counters * @return a new summed counters object */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. * @param a the first counters * @param b the second counters * @return a new summed counters object */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. * @param a the first counters * @param b the second counters * @return a new summed counters object */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Convenience method for computing the sum of two sets of counters. */ public static Counters sum(Counters a, Counters b) { Counters counters = new Counters(); counters.incrAllCounters(a); counters.incrAllCounters(b); return counters; }
/** * Increments the counters with the counters from each task. * @param counters the counters to increment * @param tips the tasks to add in to counters * @return counters the same object passed in as counters */ private Counters incrementTaskCounters(Counters counters, TaskInProgress[] tips) { for (TaskInProgress tip : tips) { counters.incrAllCounters(tip.getCounters()); } return counters; }
/** * Increments the counters with the counters from each task. * @param counters the counters to increment * @param tips the tasks to add in to counters * @return counters the same object passed in as counters */ private Counters incrementTaskCounters(Counters counters, TaskInProgress[] tips) { for (TaskInProgress tip : tips) { counters.incrAllCounters(tip.getCounters()); } return counters; }
public Counters getJobCounters(JobID id) { Job job = jobs.get(id); Counters total = new Counters(); synchronized(job.currentCounters) { for (Counters ctrs: job.currentCounters.values()) { synchronized(ctrs) { total.incrAllCounters(ctrs); } } } return total; }
/** * Updates counters corresponding to completed tasks. * @param task A map or reduce task which has just been * successfully completed */ private void updateCounters(Task task) { completedTaskCounters.incrAllCounters(task.getCounters()); }
/** * Increments the counters with the counters from each task. * @param counters the counters to increment * @param tips the tasks to add in to counters * @return counters the same object passed in as counters */ private Counters incrementTaskCounters(Counters counters, TaskInProgress[] tips) { for (TaskInProgress tip : tips) { counters.incrAllCounters(tip.getCounters()); } return counters; }
/** * Returns the total job counters, by adding together the job, * the map and the reduce counters. */ public Counters getCounters() { Counters result = new Counters(); synchronized (this) { result.incrAllCounters(getJobCounters()); } incrementTaskCounters(result, maps); return incrementTaskCounters(result, reduces); }
/** * Returns the total job counters, by adding together the job, * the map and the reduce counters. */ public synchronized Counters getCounters() { Counters result = new Counters(); result.incrAllCounters(getJobCounters()); incrementTaskCounters(result, maps); return incrementTaskCounters(result, reduces); }
/** * Returns the total job counters, by adding together the job, * the map and the reduce counters. */ public Counters getCounters() { Counters result = new Counters(); synchronized (this) { result.incrAllCounters(getJobCounters()); } // the counters of TIPs are not updated in place. // hence read-only access is ok without any locks incrementTaskCounters(result, maps); return incrementTaskCounters(result, reduces); }
counters = taskCounters; } else { counters.incrAllCounters(taskCounters);
counters = taskCounters; } else { counters.incrAllCounters(taskCounters);