MAPREDUCE-4562. Support for "FileSystemCounter" legacy counter group name for compatibility reasons is creating incorrect counter name. Contributed by Jarek Jarcec Cecho.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1373823 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0e0208b113
commit
3204b1f450
@ -169,6 +169,10 @@ Branch-2 ( Unreleased changes )
|
||||
MAPREDUCE-4484. Incorrect IS_MINI_YARN_CLUSTER property name in YarnConfiguration.
|
||||
(ahmed.radwan via tucu)
|
||||
|
||||
MAPREDUCE-4562. Support for "FileSystemCounter" legacy counter group name
|
||||
for compatibility reasons is creating incorrect counter name.
|
||||
(Jarek Jarcec Cecho via tomwhite)
|
||||
|
||||
Release 2.1.0-alpha - Unreleased
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -82,7 +82,7 @@ public abstract class AbstractCounters<C extends Counter,
|
||||
TaskCounter.class.getName());
|
||||
legacyMap.put("org.apache.hadoop.mapred.JobInProgress$Counter",
|
||||
JobCounter.class.getName());
|
||||
legacyMap.put("FileSystemCounter", FileSystemCounter.class.getName());
|
||||
legacyMap.put("FileSystemCounters", FileSystemCounter.class.getName());
|
||||
}
|
||||
|
||||
private final Limits limits = new Limits();
|
||||
|
@ -152,7 +152,7 @@ public class TestCounters {
|
||||
Counters counters = new Counters();
|
||||
counters.incrCounter(Task.Counter.MAP_INPUT_RECORDS, 1);
|
||||
counters.incrCounter(JobInProgress.Counter.DATA_LOCAL_MAPS, 1);
|
||||
counters.findCounter("FileSystemCounter", "FILE_BYTES_READ").increment(1);
|
||||
counters.findCounter("FileSystemCounters", "FILE_BYTES_READ").increment(1);
|
||||
|
||||
checkLegacyNames(counters);
|
||||
}
|
||||
@ -180,7 +180,7 @@ public class TestCounters {
|
||||
assertEquals("New name and method", 1, counters.findCounter("file",
|
||||
FileSystemCounter.BYTES_READ).getValue());
|
||||
assertEquals("Legacy name", 1, counters.findCounter(
|
||||
"FileSystemCounter",
|
||||
"FileSystemCounters",
|
||||
"FILE_BYTES_READ").getValue());
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ public class TestCounters {
|
||||
HashSet<String> groups = new HashSet<String>(counters.getGroupNames());
|
||||
HashSet<String> expectedGroups = new HashSet<String>();
|
||||
expectedGroups.add("group1");
|
||||
expectedGroups.add("FileSystemCounter"); //Legacy Name
|
||||
expectedGroups.add("FileSystemCounters"); //Legacy Name
|
||||
expectedGroups.add("org.apache.hadoop.mapreduce.FileSystemCounter");
|
||||
|
||||
assertEquals(expectedGroups, groups);
|
||||
|
Loading…
x
Reference in New Issue
Block a user