diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index fcc57dd41f1..f7486d304fd 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -547,6 +547,9 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-4152. map task left hanging after AM dies trying to connect to RM (Tom Graves via bobby) + MAPREDUCE-4297. Usersmap file in gridmix should not fail on empty lines + (Ravi Prakash via bobby) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/src/docs/src/documentation/content/xdocs/gridmix.xml b/hadoop-mapreduce-project/src/docs/src/documentation/content/xdocs/gridmix.xml index 410ca407fc3..5e5d0f41744 100644 --- a/hadoop-mapreduce-project/src/docs/src/documentation/content/xdocs/gridmix.xml +++ b/hadoop-mapreduce-project/src/docs/src/documentation/content/xdocs/gridmix.xml @@ -538,7 +538,8 @@ hadoop jar <gridmix-jar> org.apache.hadoop.mapred.gridmix.Gridmix \
For backward compatibility reasons, each line of users-list file can contain username followed by groupnames in the form username[,group]*. - The groupnames will be ignored by Gridmix. + The groupnames will be ignored by Gridmix. Empty lines will also be + ignored.
diff --git a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java index db643de6642..c06b0a24a25 100644 --- a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java +++ b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java @@ -68,15 +68,18 @@ public class RoundRobinUserResolver implements UserResolver { try { in = new LineReader(fs.open(userloc)); while (in.readLine(rawUgi) > 0) {//line is of the form username[,group]* + if(rawUgi.toString().trim().equals("")) { + continue; //Continue on empty line + } // e is end position of user name in this line int e = rawUgi.find(","); - if (rawUgi.getLength() == 0 || e == 0) { + if (e == 0) { throw new IOException("Missing username: " + rawUgi); } if (e == -1) { e = rawUgi.getLength(); } - final String username = Text.decode(rawUgi.getBytes(), 0, e); + final String username = Text.decode(rawUgi.getBytes(), 0, e).trim(); UserGroupInformation ugi = null; try { ugi = UserGroupInformation.createProxyUser(username,