MAPREDUCE-4129. Lots of unneeded counters log messages (Ahmed Radwan via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1328106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-19 20:23:47 +00:00
parent d09cf903ab
commit 7d2466c0c8
2 changed files with 16 additions and 10 deletions

View File

@ -379,6 +379,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 Iterator<G> iterator() {
* @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 synchronized G getGroup(String groupName) {
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.