doReturn(new Progress()).when(mockTask).getSortPhase(); TaskReporter mockReporter = mock(TaskReporter.class); doReturn(new Counter()).when(mockReporter).getCounter( any(TaskCounter.class)); MapOutputCollector.Context ctx = new MapOutputCollector.Context(mockTask,
/** * Get the counter for the given name and create it if it doesn't exist. * @param name the internal counter name * @return the counter */ public synchronized Counter getCounterForName(String name) { Counter result = subcounters.get(name); if (result == null) { LOG.debug("Adding " + name); result = new Counter(name, localize(name + ".name", name), 0L); subcounters.put(name, result); } return result; }
public synchronized void readFields(DataInput in) throws IOException { displayName = Text.readString(in); subcounters.clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; i++) { Counter counter = new Counter(); counter.readFields(in); subcounters.put(counter.getName(), counter); } }
@Override protected Counter newCounter(String scheme, FileSystemCounter key) { return new Counter(new FSCounter(scheme, key)); }
@Override protected Counter newCounter(String scheme, FileSystemCounter key) { return new Counter(new FSCounter(scheme, key)); }
@Override protected Counter newCounter(T key) { return new Counter(new FrameworkCounter<T>(key, getName())); }
@Override protected Counter newCounter() { return new Counter(); }
@Override protected Counter newCounter(T key) { return new Counter(new FrameworkCounter<T>(key, getName())); }
public synchronized void readFields(DataInput in) throws IOException { displayName = Text.readString(in); subcounters.clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; i++) { Counter counter = new Counter(); counter.readFields(in); subcounters.put(counter.getName(), counter); } }
public synchronized void readFields(DataInput in) throws IOException { displayName = CounterNames.intern(Text.readString(in)); subcounters.clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; i++) { Counter counter = new Counter(); counter.readFields(in); subcounters.put(counter.getName(), counter); } }
@Override protected Counter newCounter(String counterName, String displayName, long value) { return new Counter(new GenericCounter(counterName, displayName, value)); }
@Override protected Counter newCounter() { return new Counter(); }
@Override protected Counter newCounter() { return new Counter(); }
@Override protected Counter newCounter(String counterName, String displayName, long value) { return new Counter(new GenericCounter(counterName, displayName, value)); }
@Override protected Counter newCounter(String scheme, FileSystemCounter key) { return new Counter(new FSCounter(scheme, key)); }
@Override protected Counter newCounter(T key) { return new Counter(new FrameworkCounter<T>(key, getName())); }
@Override protected Counter newCounter(String counterName, String displayName, long value) { return new Counter(new GenericCounter(counterName, displayName, value)); }
@Override protected Counter newCounter() { return new Counter(); }
@Override protected Counter newCounter(String counterName, String displayName, long value) { return new Counter(new GenericCounter(counterName, displayName, value)); }
Class<Text> valueClass = (Class<Text>) jobConf.getMapOutputValueClass(); RawComparator<Text> comparator = jobConf.getOutputKeyComparator(); Counter readsCounter = new Counter(); Counter writesCounter = new Counter(); Progress mergePhase = new Progress(); RawKeyValueIterator mergeQueue = Merger.merge(conf, fs, keyClass,