svn merge -c 1328106, FIXES: MAPREDUCE-4129. Lots of unneeded counters log messages (Ahmed Radwan via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1328107 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-19 20:24:45 +00:00
parent e439d3bb39
commit 8f4c3499f5
2 changed files with 16 additions and 10 deletions

View File

@ -272,6 +272,9 @@ Release 0.23.3 - UNRELEASED
MAPREDUCE-4165. Committing is misspelled as commiting in task logs MAPREDUCE-4165. Committing is misspelled as commiting in task logs
(John Eagles via bobby) (John Eagles via bobby)
MAPREDUCE-4129. Lots of unneeded counters log messages (Ahmed Radwan via
bobby)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -201,7 +201,15 @@ public abstract class AbstractCounters<C extends Counter,
* @return the group * @return the group
*/ */
public synchronized G getGroup(String groupName) { public synchronized G getGroup(String groupName) {
String newGroupName = filterGroupName(groupName);
// filterGroupName
boolean groupNameInLegacyMap = true;
String newGroupName = legacyMap.get(groupName);
if (newGroupName == null) {
groupNameInLegacyMap = false;
newGroupName = Limits.filterGroupName(groupName);
}
boolean isFGroup = isFrameworkGroup(newGroupName); boolean isFGroup = isFrameworkGroup(newGroupName);
G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName); G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName);
if (group == null) { if (group == null) {
@ -212,19 +220,14 @@ public abstract class AbstractCounters<C extends Counter,
limits.checkGroups(groups.size() + 1); limits.checkGroups(groups.size() + 1);
groups.put(newGroupName, group); groups.put(newGroupName, group);
} }
if (groupNameInLegacyMap) {
LOG.warn("Group " + groupName + " is deprecated. Use " + newGroupName
+ " instead");
}
} }
return group; return group;
} }
private String filterGroupName(String oldName) {
String newName = legacyMap.get(oldName);
if (newName == null) {
return Limits.filterGroupName(oldName);
}
LOG.warn("Group "+ oldName +" is deprecated. Use "+ newName +" instead");
return newName;
}
/** /**
* Returns the total number of counters, by summing the number of counters * Returns the total number of counters, by summing the number of counters
* in each group. * in each group.