/** * Get the counter for the given id and create it if it doesn't exist. * @param id the numeric id of the counter within the group * @param name the internal counter name * @return the counter * @deprecated use {@link #findCounter(String)} instead */ @Deprecated public Counter getCounter(int id, String name) { return findCounter(name); }
/** * Get the counter for the given id and create it if it doesn't exist. * @param id the numeric id of the counter within the group * @param name the internal counter name * @return the counter * @deprecated use {@link #findCounter(String)} instead */ @Deprecated public Counter getCounter(int id, String name) { return findCounter(name); }
/** * Get the counter for the given id and create it if it doesn't exist. * @param id the numeric id of the counter within the group * @param name the internal counter name * @return the counter * @deprecated use {@link #findCounter(String)} instead */ @Deprecated public Counter getCounter(int id, String name) { return findCounter(name); }
/** * 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 Counter getCounterForName(String name) { return findCounter(name); }
/** * Get the counter for the given id and create it if it doesn't exist. * @param id the numeric id of the counter within the group * @param name the internal counter name * @return the counter * @deprecated use {@link #findCounter(String)} instead */ @Deprecated public Counter getCounter(int id, String name) { return findCounter(name); }
/** * 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 Counter getCounterForName(String name) { return findCounter(name); }
/** * 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 Counter getCounterForName(String name) { return findCounter(name); }
/** * 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 Counter getCounterForName(String name) { return findCounter(name); }
@Test public void testFilesystemCounter() { GroupFactory groupFactory = new GroupFactoryForTest(); Group fsGroup = groupFactory.newFileSystemGroup(); org.apache.hadoop.mapreduce.Counter count1 = fsGroup.findCounter("ANY_BYTES_READ"); Assert.assertNotNull(count1); // Verify no exception get thrown when finding an unknown counter org.apache.hadoop.mapreduce.Counter count2 = fsGroup.findCounter("Unknown"); Assert.assertNull(count2); }